Fixed SetCurrentCell for Motif, removed SelectionToDEviceRect.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7503 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1311,15 +1311,6 @@ public:
|
|||||||
wxRect BlockToDeviceRect( const wxGridCellCoords & topLeft,
|
wxRect BlockToDeviceRect( const wxGridCellCoords & topLeft,
|
||||||
const wxGridCellCoords & bottomRight );
|
const wxGridCellCoords & bottomRight );
|
||||||
|
|
||||||
// This function returns the rectangle that encloses the selected cells
|
|
||||||
// in device coords and clipped to the client size of the grid window.
|
|
||||||
//
|
|
||||||
wxRect SelectionToDeviceRect()
|
|
||||||
{
|
|
||||||
return BlockToDeviceRect( m_selectingTopLeft,
|
|
||||||
m_selectingBottomRight );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Access or update the selection fore/back colours
|
// Access or update the selection fore/back colours
|
||||||
wxColour GetSelectionBackground() const
|
wxColour GetSelectionBackground() const
|
||||||
{ return m_selectionBackground; }
|
{ return m_selectionBackground; }
|
||||||
|
@@ -5358,6 +5358,9 @@ void wxGrid::SetCurrentCell( const wxGridCellCoords& coords )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxClientDC dc(m_gridWin);
|
||||||
|
PrepareDC(dc);
|
||||||
|
|
||||||
if ( m_currentCellCoords != wxGridNoCellCoords )
|
if ( m_currentCellCoords != wxGridNoCellCoords )
|
||||||
{
|
{
|
||||||
HideCellEditControl();
|
HideCellEditControl();
|
||||||
@@ -5377,28 +5380,16 @@ void wxGrid::SetCurrentCell( const wxGridCellCoords& coords )
|
|||||||
// Otherwise refresh redraws the highlight!
|
// Otherwise refresh redraws the highlight!
|
||||||
m_currentCellCoords = coords;
|
m_currentCellCoords = coords;
|
||||||
|
|
||||||
m_gridWin->Refresh( FALSE, &r );
|
CalcCellsExposed( r );
|
||||||
|
DrawGridCellArea(dc);
|
||||||
|
DrawAllGridLines( dc, r );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_currentCellCoords = coords;
|
m_currentCellCoords = coords;
|
||||||
|
|
||||||
wxClientDC dc(m_gridWin);
|
|
||||||
PrepareDC(dc);
|
|
||||||
|
|
||||||
wxGridCellAttr* attr = GetCellAttr(coords);
|
wxGridCellAttr* attr = GetCellAttr(coords);
|
||||||
DrawCellHighlight(dc, attr);
|
DrawCellHighlight(dc, attr);
|
||||||
attr->DecRef();
|
attr->DecRef();
|
||||||
|
|
||||||
#if 0
|
|
||||||
// SN: For my extended selection code, automatic
|
|
||||||
// deselection is definitely not a good idea.
|
|
||||||
if ( IsSelection() )
|
|
||||||
{
|
|
||||||
wxRect r( SelectionToDeviceRect() );
|
|
||||||
ClearSelection();
|
|
||||||
if ( !GetBatchCount() ) m_gridWin->Refresh( FALSE, &r );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user