diff --git a/samples/grid/griddemo.cpp b/samples/grid/griddemo.cpp index 142a364f22..45beb7770d 100644 --- a/samples/grid/griddemo.cpp +++ b/samples/grid/griddemo.cpp @@ -366,7 +366,8 @@ wxBEGIN_EVENT_TABLE( GridFrame, wxFrame ) EVT_GRID_COL_SIZE( GridFrame::OnColSize ) EVT_GRID_COL_AUTO_SIZE( GridFrame::OnColAutoSize ) EVT_GRID_SELECT_CELL( GridFrame::OnSelectCell ) - EVT_GRID_RANGE_SELECT( GridFrame::OnRangeSelected ) + EVT_GRID_RANGE_SELECTING( GridFrame::OnRangeSelecting ) + EVT_GRID_RANGE_SELECTED( GridFrame::OnRangeSelected ) EVT_GRID_CELL_CHANGING( GridFrame::OnCellValueChanging ) EVT_GRID_CELL_CHANGED( GridFrame::OnCellValueChanged ) EVT_GRID_CELL_BEGIN_DRAG( GridFrame::OnCellBeginDrag ) @@ -1656,6 +1657,25 @@ void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev ) ev.Skip(); } +void GridFrame::OnRangeSelecting( wxGridRangeSelectEvent& ev ) +{ + wxString logBuf; + if ( ev.Selecting() ) + logBuf << "Selecting "; + else + logBuf << "Deselecting "; + logBuf << "cells from row " << ev.GetTopRow() + << " col " << ev.GetLeftCol() + << " to row " << ev.GetBottomRow() + << " col " << ev.GetRightCol() + << " ( ControlDown: "<< (ev.ControlDown() ? 'T':'F') + << ", ShiftDown: "<< (ev.ShiftDown() ? 'T':'F') + << ", AltDown: "<< (ev.AltDown() ? 'T':'F') + << ", MetaDown: "<< (ev.MetaDown() ? 'T':'F') << " )"; + wxLogMessage( "%s", logBuf ); + + ev.Skip(); +} void GridFrame::OnCellValueChanging( wxGridEvent& ev ) { diff --git a/samples/grid/griddemo.h b/samples/grid/griddemo.h index 784e0fca3d..e09b96a05d 100644 --- a/samples/grid/griddemo.h +++ b/samples/grid/griddemo.h @@ -110,6 +110,7 @@ class GridFrame : public wxFrame void OnColAutoSize( wxGridSizeEvent& ); void OnSelectCell( wxGridEvent& ); void OnRangeSelected( wxGridRangeSelectEvent& ); + void OnRangeSelecting( wxGridRangeSelectEvent& ); void OnCellValueChanging( wxGridEvent& ); void OnCellValueChanged( wxGridEvent& ); void OnCellBeginDrag( wxGridEvent& ); diff --git a/src/generic/gridsel.cpp b/src/generic/gridsel.cpp index a31a01a90b..0405e9d041 100644 --- a/src/generic/gridsel.cpp +++ b/src/generic/gridsel.cpp @@ -67,7 +67,6 @@ void wxGridSelection::EndSelecting() //send the RANGE_SELECTED events if (IsSelection()) { - size_t n; wxRect r; wxGridCellCoords coords1, coords2;