};
-const wxEventType EVT_WXGRID_CELL_LEFT_CLICK = wxEVT_FIRST + 1580;
-const wxEventType EVT_WXGRID_CELL_RIGHT_CLICK = wxEVT_FIRST + 1581;
-const wxEventType EVT_WXGRID_CELL_LEFT_DCLICK = wxEVT_FIRST + 1582;
-const wxEventType EVT_WXGRID_CELL_RIGHT_DCLICK = wxEVT_FIRST + 1583;
-const wxEventType EVT_WXGRID_LABEL_LEFT_CLICK = wxEVT_FIRST + 1584;
-const wxEventType EVT_WXGRID_LABEL_RIGHT_CLICK = wxEVT_FIRST + 1585;
-const wxEventType EVT_WXGRID_LABEL_LEFT_DCLICK = wxEVT_FIRST + 1586;
-const wxEventType EVT_WXGRID_LABEL_RIGHT_DCLICK = wxEVT_FIRST + 1587;
-const wxEventType EVT_WXGRID_ROW_SIZE = wxEVT_FIRST + 1588;
-const wxEventType EVT_WXGRID_COL_SIZE = wxEVT_FIRST + 1589;
-const wxEventType EVT_WXGRID_RANGE_SELECT = wxEVT_FIRST + 1590;
-const wxEventType EVT_WXGRID_CELL_CHANGE = wxEVT_FIRST + 1591;
+const wxEventType EVT_GRID_CELL_LEFT_CLICK = wxEVT_FIRST + 1580;
+const wxEventType EVT_GRID_CELL_RIGHT_CLICK = wxEVT_FIRST + 1581;
+const wxEventType EVT_GRID_CELL_LEFT_DCLICK = wxEVT_FIRST + 1582;
+const wxEventType EVT_GRID_CELL_RIGHT_DCLICK = wxEVT_FIRST + 1583;
+const wxEventType EVT_GRID_LABEL_LEFT_CLICK = wxEVT_FIRST + 1584;
+const wxEventType EVT_GRID_LABEL_RIGHT_CLICK = wxEVT_FIRST + 1585;
+const wxEventType EVT_GRID_LABEL_LEFT_DCLICK = wxEVT_FIRST + 1586;
+const wxEventType EVT_GRID_LABEL_RIGHT_DCLICK = wxEVT_FIRST + 1587;
+const wxEventType EVT_GRID_ROW_SIZE = wxEVT_FIRST + 1588;
+const wxEventType EVT_GRID_COL_SIZE = wxEVT_FIRST + 1589;
+const wxEventType EVT_GRID_RANGE_SELECT = wxEVT_FIRST + 1590;
+const wxEventType EVT_GRID_CELL_CHANGE = wxEVT_FIRST + 1591;
typedef void (wxEvtHandler::*wxGridEventFunction)(wxGridEvent&);
typedef void (wxEvtHandler::*wxGridSizeEventFunction)(wxGridSizeEvent&);
typedef void (wxEvtHandler::*wxGridRangeSelectEventFunction)(wxGridRangeSelectEvent&);
-#define EVT_WXGRID_CELL_LEFT_CLICK(fn) { EVT_WXGRID_CELL_LEFT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
-#define EVT_WXGRID_CELL_RIGHT_CLICK(fn) { EVT_WXGRID_CELL_RIGHT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
-#define EVT_WXGRID_CELL_LEFT_DCLICK(fn) { EVT_WXGRID_CELL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
-#define EVT_WXGRID_CELL_RIGHT_DCLICK(fn) { EVT_WXGRID_CELL_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
-#define EVT_WXGRID_LABEL_LEFT_CLICK(fn) { EVT_WXGRID_LABEL_LEFT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
-#define EVT_WXGRID_LABEL_RIGHT_CLICK(fn) { EVT_WXGRID_LABEL_RIGHT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
-#define EVT_WXGRID_LABEL_LEFT_DCLICK(fn) { EVT_WXGRID_LABEL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
-#define EVT_WXGRID_LABEL_RIGHT_DCLICK(fn) { EVT_WXGRID_LABEL_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
-#define EVT_WXGRID_ROW_SIZE(fn) { EVT_WXGRID_ROW_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridSizeEventFunction) &fn, NULL },
-#define EVT_WXGRID_COL_SIZE(fn) { EVT_WXGRID_COL_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridSizeEventFunction) &fn, NULL },
-#define EVT_WXGRID_RANGE_SELECT(fn) { EVT_WXGRID_RANGE_SELECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridRangeSelectEventFunction) &fn, NULL },
-#define EVT_WXGRID_CELL_CHANGE(fn) { EVT_WXGRID_CELL_CHANGE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
+#define EVT_GRID_CELL_LEFT_CLICK(fn) { EVT_GRID_CELL_LEFT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
+#define EVT_GRID_CELL_RIGHT_CLICK(fn) { EVT_GRID_CELL_RIGHT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
+#define EVT_GRID_CELL_LEFT_DCLICK(fn) { EVT_GRID_CELL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
+#define EVT_GRID_CELL_RIGHT_DCLICK(fn) { EVT_GRID_CELL_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
+#define EVT_GRID_LABEL_LEFT_CLICK(fn) { EVT_GRID_LABEL_LEFT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
+#define EVT_GRID_LABEL_RIGHT_CLICK(fn) { EVT_GRID_LABEL_RIGHT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
+#define EVT_GRID_LABEL_LEFT_DCLICK(fn) { EVT_GRID_LABEL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
+#define EVT_GRID_LABEL_RIGHT_DCLICK(fn) { EVT_GRID_LABEL_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
+#define EVT_GRID_ROW_SIZE(fn) { EVT_GRID_ROW_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridSizeEventFunction) &fn, NULL },
+#define EVT_GRID_COL_SIZE(fn) { EVT_GRID_COL_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridSizeEventFunction) &fn, NULL },
+#define EVT_GRID_RANGE_SELECT(fn) { EVT_GRID_RANGE_SELECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridRangeSelectEventFunction) &fn, NULL },
+#define EVT_GRID_CELL_CHANGE(fn) { EVT_GRID_CELL_CHANGE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
#if 0 // TODO: implement these ? others ?
-const wxEventType EVT_WXGRID_SELECT_CELL = wxEVT_FIRST + 1575;
-const wxEventType EVT_WXGRID_CREATE_CELL = wxEVT_FIRST + 1576;
-const wxEventType EVT_WXGRID_CHANGE_LABELS = wxEVT_FIRST + 1577;
-const wxEventType EVT_WXGRID_CHANGE_SEL_LABEL = wxEVT_FIRST + 1578;
+const wxEventType EVT_GRID_SELECT_CELL = wxEVT_FIRST + 1575;
+const wxEventType EVT_GRID_CREATE_CELL = wxEVT_FIRST + 1576;
+const wxEventType EVT_GRID_CHANGE_LABELS = wxEVT_FIRST + 1577;
+const wxEventType EVT_GRID_CHANGE_SEL_LABEL = wxEVT_FIRST + 1578;
-#define EVT_WXGRID_SELECT_CELL(fn) { EVT_WXGRID_SELECT_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
-#define EVT_WXGRID_CREATE_CELL(fn) { EVT_WXGRID_CREATE_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
-#define EVT_WXGRID_CHANGE_LABELS(fn) { EVT_WXGRID_CHANGE_LABELS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
-#define EVT_WXGRID_CHANGE_SEL_LABEL(fn) { EVT_WXGRID_CHANGE_SEL_LABEL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
+#define EVT_GRID_SELECT_CELL(fn) { EVT_GRID_SELECT_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
+#define EVT_GRID_CREATE_CELL(fn) { EVT_GRID_CREATE_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
+#define EVT_GRID_CHANGE_LABELS(fn) { EVT_GRID_CHANGE_LABELS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
+#define EVT_GRID_CHANGE_SEL_LABEL(fn) { EVT_GRID_CHANGE_SEL_LABEL, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxGridEventFunction) &fn, NULL },
#endif
int row, int col,
wxMouseEvent& mouseEv )
{
- if ( type == EVT_WXGRID_ROW_SIZE ||
- type == EVT_WXGRID_COL_SIZE )
+ if ( type == EVT_GRID_ROW_SIZE ||
+ type == EVT_GRID_COL_SIZE )
{
int rowOrCol = (row == -1 ? col : row);
return GetEventHandler()->ProcessEvent(gridEvt);
}
- else if ( type == EVT_WXGRID_RANGE_SELECT )
+ else if ( type == EVT_GRID_RANGE_SELECT )
{
wxGridRangeSelectEvent gridEvt( GetId(),
type,
bool wxGrid::SendEvent( const wxEventType type,
int row, int col )
{
- if ( type == EVT_WXGRID_ROW_SIZE ||
- type == EVT_WXGRID_COL_SIZE )
+ if ( type == EVT_GRID_ROW_SIZE ||
+ type == EVT_GRID_COL_SIZE )
{
int rowOrCol = (row == -1 ? col : row);
if ( YToEdgeOfRow(y) < 0 )
{
row = YToRow(y);
- if ( !SendEvent( EVT_WXGRID_LABEL_LEFT_CLICK, row, col, ev ) )
+ if ( !SendEvent( EVT_GRID_LABEL_LEFT_CLICK, row, col, ev ) )
{
SelectRow( row, ev.ShiftDown() );
m_cursorMode = WXGRID_CURSOR_SELECT_ROW;
if ( XToEdgeOfCol(x) < 0 )
{
col = XToCol(x);
- if ( !SendEvent( EVT_WXGRID_LABEL_LEFT_CLICK, row, col, ev ) )
+ if ( !SendEvent( EVT_GRID_LABEL_LEFT_CLICK, row, col, ev ) )
{
SelectCol( col, ev.ShiftDown() );
m_cursorMode = WXGRID_CURSOR_SELECT_COL;
{
// leave both row and col as -1
//
- if ( !SendEvent( EVT_WXGRID_LABEL_LEFT_CLICK, row, col, ev ) )
+ if ( !SendEvent( EVT_GRID_LABEL_LEFT_CLICK, row, col, ev ) )
{
SelectAll();
}
case WXGRID_CELL:
{
XYToCell( x, y, cellCoords );
- if ( !SendEvent( EVT_WXGRID_CELL_LEFT_CLICK,
+ if ( !SendEvent( EVT_GRID_CELL_LEFT_CLICK,
cellCoords.GetRow(),
cellCoords.GetCol(),
ev ) )
if ( YToEdgeOfRow(y) < 0 )
{
row = YToRow(y);
- SendEvent( EVT_WXGRID_LABEL_LEFT_DCLICK, row, col, ev );
+ SendEvent( EVT_GRID_LABEL_LEFT_DCLICK, row, col, ev );
}
}
break;
if ( XToEdgeOfCol(x) < 0 )
{
col = XToCol(x);
- SendEvent( EVT_WXGRID_LABEL_LEFT_DCLICK, row, col, ev );
+ SendEvent( EVT_GRID_LABEL_LEFT_DCLICK, row, col, ev );
}
}
break;
{
// leave both row and col as -1
//
- SendEvent( EVT_WXGRID_LABEL_LEFT_DCLICK, row, col, ev );
+ SendEvent( EVT_GRID_LABEL_LEFT_DCLICK, row, col, ev );
}
break;
case WXGRID_CELL:
{
XYToCell( x, y, cellCoords );
- SendEvent( EVT_WXGRID_CELL_LEFT_DCLICK,
+ SendEvent( EVT_GRID_CELL_LEFT_DCLICK,
cellCoords.GetRow(),
cellCoords.GetCol(),
ev );
// Note: we are ending the event *after* doing
// default processing in this case
//
- SendEvent( EVT_WXGRID_ROW_SIZE, m_dragRowOrCol, -1, ev );
+ SendEvent( EVT_GRID_ROW_SIZE, m_dragRowOrCol, -1, ev );
}
}
break;
// Note: we are ending the event *after* doing
// default processing in this case
//
- SendEvent( EVT_WXGRID_COL_SIZE, -1, m_dragRowOrCol, ev );
+ SendEvent( EVT_GRID_COL_SIZE, -1, m_dragRowOrCol, ev );
}
}
break;
// Note: we are ending the event *after* doing
// default processing in this case
//
- SendEvent( EVT_WXGRID_RANGE_SELECT, -1, -1, ev );
+ SendEvent( EVT_GRID_RANGE_SELECT, -1, -1, ev );
}
}
break;
case WXGRID_ROWLABEL:
{
row = YToRow(y);
- if ( !SendEvent( EVT_WXGRID_LABEL_RIGHT_CLICK, row, col, ev ) )
+ if ( !SendEvent( EVT_GRID_LABEL_RIGHT_CLICK, row, col, ev ) )
{
// TODO: default processing ?
}
case WXGRID_COLLABEL:
{
col = XToCol(x);
- if ( !SendEvent( EVT_WXGRID_LABEL_RIGHT_CLICK, row, col, ev ) )
+ if ( !SendEvent( EVT_GRID_LABEL_RIGHT_CLICK, row, col, ev ) )
{
// TODO: default processing ?
}
{
// leave both row and col as -1
//
- if ( !SendEvent( EVT_WXGRID_LABEL_RIGHT_CLICK, row, col, ev ) )
+ if ( !SendEvent( EVT_GRID_LABEL_RIGHT_CLICK, row, col, ev ) )
{
// TODO: default processing ?
}
case WXGRID_CELL:
{
XYToCell( x, y, cellCoords );
- if ( !SendEvent( EVT_WXGRID_CELL_RIGHT_CLICK,
+ if ( !SendEvent( EVT_GRID_CELL_RIGHT_CLICK,
cellCoords.GetRow(),
cellCoords.GetCol(),
ev ) )
case WXGRID_ROWLABEL:
{
row = YToRow(y);
- SendEvent( EVT_WXGRID_LABEL_RIGHT_DCLICK, row, col, ev );
+ SendEvent( EVT_GRID_LABEL_RIGHT_DCLICK, row, col, ev );
}
break;
case WXGRID_COLLABEL:
{
col = XToCol(x);
- SendEvent( EVT_WXGRID_LABEL_RIGHT_DCLICK, row, col, ev );
+ SendEvent( EVT_GRID_LABEL_RIGHT_DCLICK, row, col, ev );
}
break;
{
// leave both row and col as -1
//
- SendEvent( EVT_WXGRID_LABEL_RIGHT_DCLICK, row, col, ev );
+ SendEvent( EVT_GRID_LABEL_RIGHT_DCLICK, row, col, ev );
}
break;
case WXGRID_CELL:
{
XYToCell( x, y, cellCoords );
- SendEvent( EVT_WXGRID_CELL_RIGHT_DCLICK,
+ SendEvent( EVT_GRID_CELL_RIGHT_DCLICK,
cellCoords.GetRow(),
cellCoords.GetCol(),
ev );
if ( valueChanged )
{
- SendEvent( EVT_WXGRID_CELL_CHANGE,
+ SendEvent( EVT_GRID_CELL_CHANGE,
m_currentCellCoords.GetRow(),
m_currentCellCoords.GetCol() );
}
// Note: we are ending the event *after* doing
// default processing in this case
//
- SendEvent( EVT_WXGRID_ROW_SIZE,
+ SendEvent( EVT_GRID_ROW_SIZE,
row, -1 );
}
else
// Note: we are ending the event *after* doing
// default processing in this case
//
- SendEvent( EVT_WXGRID_COL_SIZE,
+ SendEvent( EVT_GRID_COL_SIZE,
-1, col );
}
else
}
wxGridRangeSelectEvent gridEvt( GetId(),
- EVT_WXGRID_RANGE_SELECT,
+ EVT_GRID_RANGE_SELECT,
this,
m_selectedTopLeft,
m_selectedBottomRight );
}
wxGridRangeSelectEvent gridEvt( GetId(),
- EVT_WXGRID_RANGE_SELECT,
+ EVT_GRID_RANGE_SELECT,
this,
m_selectedTopLeft,
m_selectedBottomRight );
if ( !m_isDragging )
{
wxGridRangeSelectEvent gridEvt( GetId(),
- EVT_WXGRID_RANGE_SELECT,
+ EVT_GRID_RANGE_SELECT,
this,
m_selectedTopLeft,
m_selectedBottomRight );