diff --git a/docs/changes.txt b/docs/changes.txt index 1a7c665b57..35fb351d8d 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -603,6 +603,7 @@ wxMSW: - Fix background of wxRadioBox buttons and wxSlider (Artur Wieczorek). - Fix appearance of wxToggleButtons with non default colours (Artur Wieczorek). - Fix drawing on wxDC when using right-to-left layout (Artur Wieczorek). +- Fix wxGrid appearance and behaviour in RTL (Artur Wieczorek). 3.0.1: (released 2014-06-15) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index f60841049d..6d7815a3ab 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -1680,10 +1680,7 @@ void wxGridColLabelWindow::OnPaint( wxPaintEvent& WXUNUSED(event) ) int x, y; m_owner->CalcUnscrolledPosition( 0, 0, &x, &y ); wxPoint pt = dc.GetDeviceOrigin(); - if (GetLayoutDirection() == wxLayout_RightToLeft) - dc.SetDeviceOrigin( pt.x+x, pt.y ); - else - dc.SetDeviceOrigin( pt.x-x, pt.y ); + dc.SetDeviceOrigin( pt.x-x, pt.y ); wxArrayInt cols = m_owner->CalcColLabelsExposed( GetUpdateRegion() ); m_owner->DrawColLabels( dc, cols ); @@ -3736,13 +3733,9 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event ) // and check if we're on the "near" (usually left but right // in RTL case) part of the column - bool onNearPart; const int middle = GetColLeft(colValid) + GetColWidth(colValid)/2; - if ( GetLayoutDirection() == wxLayout_LeftToRight ) - onNearPart = (x <= middle); - else // wxLayout_RightToLeft - onNearPart = (x > middle); + const bool onNearPart = (x <= middle); // adjust for the column being dragged itself if ( pos < GetColPos(m_dragRowOrCol) )