Update grid sample to show selecting events
This commit is contained in:
committed by
Vadim Zeitlin
parent
415f080c80
commit
decc255846
@@ -366,7 +366,8 @@ wxBEGIN_EVENT_TABLE( GridFrame, wxFrame )
|
|||||||
EVT_GRID_COL_SIZE( GridFrame::OnColSize )
|
EVT_GRID_COL_SIZE( GridFrame::OnColSize )
|
||||||
EVT_GRID_COL_AUTO_SIZE( GridFrame::OnColAutoSize )
|
EVT_GRID_COL_AUTO_SIZE( GridFrame::OnColAutoSize )
|
||||||
EVT_GRID_SELECT_CELL( GridFrame::OnSelectCell )
|
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_CHANGING( GridFrame::OnCellValueChanging )
|
||||||
EVT_GRID_CELL_CHANGED( GridFrame::OnCellValueChanged )
|
EVT_GRID_CELL_CHANGED( GridFrame::OnCellValueChanged )
|
||||||
EVT_GRID_CELL_BEGIN_DRAG( GridFrame::OnCellBeginDrag )
|
EVT_GRID_CELL_BEGIN_DRAG( GridFrame::OnCellBeginDrag )
|
||||||
@@ -1656,6 +1657,25 @@ void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev )
|
|||||||
|
|
||||||
ev.Skip();
|
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 )
|
void GridFrame::OnCellValueChanging( wxGridEvent& ev )
|
||||||
{
|
{
|
||||||
|
@@ -110,6 +110,7 @@ class GridFrame : public wxFrame
|
|||||||
void OnColAutoSize( wxGridSizeEvent& );
|
void OnColAutoSize( wxGridSizeEvent& );
|
||||||
void OnSelectCell( wxGridEvent& );
|
void OnSelectCell( wxGridEvent& );
|
||||||
void OnRangeSelected( wxGridRangeSelectEvent& );
|
void OnRangeSelected( wxGridRangeSelectEvent& );
|
||||||
|
void OnRangeSelecting( wxGridRangeSelectEvent& );
|
||||||
void OnCellValueChanging( wxGridEvent& );
|
void OnCellValueChanging( wxGridEvent& );
|
||||||
void OnCellValueChanged( wxGridEvent& );
|
void OnCellValueChanged( wxGridEvent& );
|
||||||
void OnCellBeginDrag( wxGridEvent& );
|
void OnCellBeginDrag( wxGridEvent& );
|
||||||
|
@@ -67,7 +67,6 @@ void wxGridSelection::EndSelecting()
|
|||||||
//send the RANGE_SELECTED events
|
//send the RANGE_SELECTED events
|
||||||
if (IsSelection())
|
if (IsSelection())
|
||||||
{
|
{
|
||||||
size_t n;
|
|
||||||
wxRect r;
|
wxRect r;
|
||||||
wxGridCellCoords coords1, coords2;
|
wxGridCellCoords coords1, coords2;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user