Modified wxGrid::SetCurrentCell() to fix problem under wxMSW where
the grid was spending time drawing cells outside the visible area. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7529 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -5360,21 +5360,24 @@ void wxGrid::SetCurrentCell( const wxGridCellCoords& coords )
|
|||||||
HideCellEditControl();
|
HideCellEditControl();
|
||||||
DisableCellEditControl();
|
DisableCellEditControl();
|
||||||
|
|
||||||
// Clear the old current cell highlight
|
wxRect r;
|
||||||
wxRect r = BlockToDeviceRect(m_currentCellCoords, m_currentCellCoords);
|
if ( IsVisible( m_currentCellCoords ) )
|
||||||
|
|
||||||
if ( !m_gridLinesEnabled )
|
|
||||||
{
|
{
|
||||||
r.x--;
|
r = BlockToDeviceRect(m_currentCellCoords, m_currentCellCoords);
|
||||||
r.y--;
|
CalcCellsExposed( r );
|
||||||
r.width++;
|
|
||||||
r.height++;
|
if ( !m_gridLinesEnabled )
|
||||||
|
{
|
||||||
|
r.x--;
|
||||||
|
r.y--;
|
||||||
|
r.width++;
|
||||||
|
r.height++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise refresh redraws the highlight!
|
||||||
|
m_currentCellCoords = coords;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise refresh redraws the highlight!
|
|
||||||
m_currentCellCoords = coords;
|
|
||||||
|
|
||||||
CalcCellsExposed( r );
|
|
||||||
DrawGridCellArea(dc);
|
DrawGridCellArea(dc);
|
||||||
DrawAllGridLines( dc, r );
|
DrawAllGridLines( dc, r );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user