This event class contains information about various grid events.
Notice that all grid event table macros are available in two versions: EVT_GRID_XXX
and EVT_GRID_CMD_XXX
. The only difference between the two is that the former doesn’t allow to specify the grid window identifier and so takes a single parameter, the event handler, but is not suitable if there is more than one grid control in the window where the event table is used (as it would catch the events from all the grids). The version with CMD
takes the id as first argument and the event handler as the second one and so can be used with multiple grids as well. Otherwise there are no difference between the two and only the versions without the id are documented below for brevity.
Handlers bound for the following event types will receive a wx.grid.GridEvent parameter.
GetString
event object method. This event can be vetoed if the change is not allowed. Processes a wxEVT_GRID_CELL_CHANGING
event type.GetString
event object method. Notice that vetoing this event still works for backwards compatibility reasons but any new code should only veto EVT_GRID_CELL_CHANGING
event and not this one. Processes a wxEVT_GRID_CELL_CHANGED
event type.wxEVT_GRID_CELL_LEFT_CLICK
event type.wxEVT_GRID_CELL_LEFT_DCLICK
event type.wxEVT_GRID_CELL_RIGHT_CLICK
event type.wxEVT_GRID_CELL_RIGHT_DCLICK
event type.wxEVT_GRID_EDITOR_HIDDEN
event type.wxEVT_GRID_EDITOR_SHOWN
event type.wxEVT_GRID_LABEL_LEFT_CLICK
event type.wxEVT_GRID_LABEL_LEFT_DCLICK
event type.wxEVT_GRID_LABEL_RIGHT_CLICK
event type.wxEVT_GRID_LABEL_RIGHT_DCLICK
event type.wxEVT_GRID_SELECT_CELL
event type.GetCol
. This event can be vetoed to either prevent the user from reordering the column change completely (but notice that if you don’t want to allow it at all, you simply shouldn’t call wx.grid.Grid.EnableDragColMove
in the first place), vetoed but handled in some way in the handler, e.g. by really moving the column to the new position at the associated table level, or allowed to proceed in which case wx.grid.Grid.SetColPos
is used to reorder the columns display order without affecting the use of the column indices otherwise. This event macro corresponds to wxEVT_GRID_COL_MOVE
event type.wxEVT_GRID_COL_SORT
event type.TAB
or Shift-TAB in the grid. It can be used to customize the simple default TAB
handling logic, e.g. to go to the next non-empty cell instead of just the next cell. See also wx.grid.Grid.SetTabBehaviour
. This event is new since wxWidgets 2.9.5.__init__ |
Default constructor. |
AltDown |
Returns True if the Alt key was down at the time of the event. |
ControlDown |
Returns True if the Control key was down at the time of the event. |
GetCol |
Column at which the event occurred. |
GetPosition |
Position in pixels at which the event occurred. |
GetRow |
Row at which the event occurred. |
MetaDown |
Returns True if the Meta key was down at the time of the event. |
Selecting |
Returns True if the user is selecting grid cells, or False if deselecting. |
ShiftDown |
Returns True if the Shift key was down at the time of the event. |
wx.grid.
GridEvent
(NotifyEvent)¶Possible constructors:
GridEvent()
GridEvent(id, type, obj, row=-1, col=-1, x=-1, y=-1, sel=True,
kbd=KeyboardState())
This event class contains information about various grid events.
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
__init__ (self, id, type, obj, row=-1, col=-1, x=-1, y=-1, sel=True, kbd=KeyboardState())
Constructor for initializing all event attributes.
Parameters: |
|
---|
AltDown
(self)¶Returns True
if the Alt key was down at the time of the event.
Return type: | bool |
---|
ControlDown
(self)¶Returns True
if the Control key was down at the time of the event.
Return type: | bool |
---|
GetCol
(self)¶Column at which the event occurred.
Notice that for a wxEVT_GRID_SELECT_CELL
event this column is the column of the newly selected cell while the previously selected cell can be retrieved using wx.grid.Grid.GetGridCursorCol
.
Return type: | int |
---|
GetPosition
(self)¶Position in pixels at which the event occurred.
Return type: | Point |
---|
GetRow
(self)¶Row at which the event occurred.
Notice that for a wxEVT_GRID_SELECT_CELL
event this row is the row of the newly selected cell while the previously selected cell can be retrieved using wx.grid.Grid.GetGridCursorRow
.
Return type: | int |
---|
MetaDown
(self)¶Returns True
if the Meta key was down at the time of the event.
Return type: | bool |
---|
Selecting
(self)¶Returns True
if the user is selecting grid cells, or False
if deselecting.
Return type: | bool |
---|
ShiftDown
(self)¶Returns True
if the Shift key was down at the time of the event.
Return type: | bool |
---|
Position
¶See GetPosition