Class: Wx::GRID::GridEvent
- Inherits:
-
NotifyEvent
- Object
- Object
- Event
- CommandEvent
- NotifyEvent
- Wx::GRID::GridEvent
- Defined in:
- lib/wx/doc/gen/grid/grid_event.rb
Overview
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.
Events using this class
The following event-handler methods redirect the events to member method or handler blocks for GridEvent events. Event handler methods:
-
EvtHandler#evt_grid_cell_changing(meth = nil, &block): The user is about to change the data in a cell. The new cell value as string is available from CommandEvent#get_string event object method. This event can be vetoed if the change is not allowed. Processes a EVT_GRID_CELL_CHANGING event type.
-
EvtHandler#evt_grid_cell_changed(meth = nil, &block): The user changed the data in a cell. The old cell value as string is available from CommandEvent#get_string 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 EVT_GRID_CELL_CHANGED event type.
-
EvtHandler#evt_grid_cell_left_click(meth = nil, &block): The user clicked a cell with the left mouse button. Processes a EVT_GRID_CELL_LEFT_CLICK event type.
-
EvtHandler#evt_grid_cell_left_dclick(meth = nil, &block): The user double-clicked a cell with the left mouse button. Processes a EVT_GRID_CELL_LEFT_DCLICK event type.
-
EvtHandler#evt_grid_cell_right_click(meth = nil, &block): The user clicked a cell with the right mouse button. Processes a EVT_GRID_CELL_RIGHT_CLICK event type.
-
EvtHandler#evt_grid_cell_right_dclick(meth = nil, &block): The user double-clicked a cell with the right mouse button. Processes a EVT_GRID_CELL_RIGHT_DCLICK event type.
-
EvtHandler#evt_grid_editor_hidden(meth = nil, &block): The editor for a cell was hidden. Processes a EVT_GRID_EDITOR_HIDDEN event type.
-
EvtHandler#evt_grid_editor_shown(meth = nil, &block): The editor for a cell was shown. Processes a EVT_GRID_EDITOR_SHOWN event type.
-
EvtHandler#evt_grid_label_left_click(meth = nil, &block): The user clicked a label with the left mouse button. Processes a EVT_GRID_LABEL_LEFT_CLICK event type.
-
EvtHandler#evt_grid_label_left_dclick(meth = nil, &block): The user double-clicked a label with the left mouse button. Processes a EVT_GRID_LABEL_LEFT_DCLICK event type.
-
EvtHandler#evt_grid_label_right_click(meth = nil, &block): The user clicked a label with the right mouse button. Processes a EVT_GRID_LABEL_RIGHT_CLICK event type.
-
EvtHandler#evt_grid_label_right_dclick(meth = nil, &block): The user double-clicked a label with the right mouse button. Processes a EVT_GRID_LABEL_RIGHT_DCLICK event type.
-
EvtHandler#evt_grid_select_cell(meth = nil, &block): The given cell is about to be made current, either by user or by the program via a call to Wx::GRID::Grid#set_grid_cursor or Wx::GRID::Grid#go_to_cell. The event can be vetoed to prevent this from happening and Wx::GRID::Grid#get_grid_cursor_coords still returns the previous current cell coordinates during the event handler execution, while the new ones are available via the event object #get_row and #get_col functions. Processes a EVT_GRID_SELECT_CELL event type.
-
EvtHandler#evt_grid_row_move(meth = nil, &block): The user tries to change the order of the rows in the grid by dragging the row specified by #get_row. This event can be vetoed to either prevent the user from reordering the row change completely (but notice that if you don't want to allow it at all, you simply shouldn't call Wx::GRID::Grid#enable_drag_row_move in the first place), vetoed but handled in some way in the handler, e.g. by really moving the row to the new position at the associated table level, or allowed to proceed in which case Wx::GRID::Grid#set_row_pos is used to reorder the rows display order without affecting the use of the row indices otherwise. This event macro corresponds to EVT_GRID_ROW_MOVE event type. It is only available since wxWidgets 3.1.7.
-
EvtHandler#evt_grid_col_move(meth = nil, &block): The user tries to change the order of the columns in the grid by dragging the column specified by #get_col. 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#enable_drag_col_move 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#set_col_pos is used to reorder the columns display order without affecting the use of the column indices otherwise. This event macro corresponds to EVT_GRID_COL_MOVE event type.
-
EvtHandler#evt_grid_col_sort(meth = nil, &block): This event is generated when a column is clicked by the user and its name is explained by the fact that the custom reaction to a click on a column is to sort the grid contents by this column. However the grid itself has no special support for sorting and it's up to the handler of this event to update the associated table. But if the event is handled (and not vetoed) the grid supposes that the table was indeed resorted and updates the column to indicate the new sort order and refreshes itself. This event macro corresponds to EVT_GRID_COL_SORT event type.
-
EvtHandler#evt_grid_tabbing(meth = nil, &block): This event is generated when the user presses 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#set_tab_behaviour. This event is new since wxWidgets 2.9.5.
Category: Grid Related Classes, Events
Instance Method Summary collapse
-
#alt_down ⇒ Boolean
Returns true if the Alt key was down at the time of the event.
-
#control_down ⇒ Boolean
Returns true if the Control key was down at the time of the event.
-
#get_col ⇒ Integer
(also: #col)
Column at which the event occurred.
-
#get_position ⇒ Wx::Point
(also: #position)
Position in pixels at which the event occurred.
-
#get_row ⇒ Integer
(also: #row)
Row at which the event occurred.
-
#initialize(*args) ⇒ GridEvent
constructor
A new instance of GridEvent.
-
#meta_down ⇒ Boolean
Returns true if the Meta key was down at the time of the event.
-
#selecting ⇒ Boolean
Returns true if the user is selecting grid cells, or false if deselecting.
-
#shift_down ⇒ Boolean
Returns true if the Shift key was down at the time of the event.
Methods inherited from NotifyEvent
Methods inherited from CommandEvent
#client_data, #client_data=, #get_client_data, #get_client_object, #get_int, #get_selection, #get_string, #is_checked, #is_selection, #set_client_data, #set_client_object, #set_extra_long, #set_int, #set_string
Methods inherited from Event
#clone, #get_event_category, #get_event_object, #get_event_type, #get_id, #get_skipped, #get_timestamp, #is_command_event, #resume_propagation, #set_event_object, #set_event_type, #set_id, #set_timestamp, #should_propagate, #skip, #stop_propagation
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize ⇒ Wx::GRID::GridEvent #initialize(id, type, obj, row = -1, col = -1, x = -1, y = -1, sel = true, kbd = (Wx::KeyboardState.new())) ⇒ Wx::GRID::GridEvent
Returns a new instance of GridEvent.
73 |
# File 'lib/wx/doc/gen/grid/grid_event.rb', line 73 def initialize(*args) end |
Instance Method Details
#alt_down ⇒ Boolean
Returns true if the Alt key was down at the time of the event.
77 |
# File 'lib/wx/doc/gen/grid/grid_event.rb', line 77 def alt_down; end |
#control_down ⇒ Boolean
Returns true if the Control key was down at the time of the event.
81 |
# File 'lib/wx/doc/gen/grid/grid_event.rb', line 81 def control_down; end |
#get_col ⇒ Integer Also known as: col
Column at which the event occurred.
Notice that for a EVT_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#get_grid_cursor_col.
87 |
# File 'lib/wx/doc/gen/grid/grid_event.rb', line 87 def get_col; end |
#get_position ⇒ Wx::Point Also known as: position
Position in pixels at which the event occurred.
92 |
# File 'lib/wx/doc/gen/grid/grid_event.rb', line 92 def get_position; end |
#get_row ⇒ Integer Also known as: row
Row at which the event occurred.
Notice that for a EVT_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#get_grid_cursor_row.
99 |
# File 'lib/wx/doc/gen/grid/grid_event.rb', line 99 def get_row; end |
#meta_down ⇒ Boolean
Returns true if the Meta key was down at the time of the event.
104 |
# File 'lib/wx/doc/gen/grid/grid_event.rb', line 104 def ; end |
#selecting ⇒ Boolean
Returns true if the user is selecting grid cells, or false if deselecting.
108 |
# File 'lib/wx/doc/gen/grid/grid_event.rb', line 108 def selecting; end |
#shift_down ⇒ Boolean
Returns true if the Shift key was down at the time of the event.
112 |
# File 'lib/wx/doc/gen/grid/grid_event.rb', line 112 def shift_down; end |