Class: Wx::TreeEvent
- Inherits:
-
NotifyEvent
- Object
- Object
- Event
- CommandEvent
- NotifyEvent
- Wx::TreeEvent
- Defined in:
- lib/wx/doc/gen/tree_event.rb
Overview
A tree event holds information about events associated with TreeCtrl objects.
To process input from a tree control, use these event handler macros to direct input to member functions that take a TreeEvent argument.
Events using this class
The following event-handler methods redirect the events to member method or handler blocks for TreeEvent events. Event handler methods:
-
EvtHandler#evt_tree_begin_drag(id, meth = nil, &block): Begin dragging with the left mouse button. If you want to enable left-dragging you need to intercept this event and explicitly call #allow, as it's vetoed by default. Also notice that the control must have an associated image list (see SetImageList()) to drag its items under MSW.
-
EvtHandler#evt_tree_begin_rdrag(id, meth = nil, &block): Begin dragging with the right mouse button. If you want to enable right-dragging you need to intercept this event and explicitly call #allow, as it's vetoed by default.
-
EvtHandler#evt_tree_end_drag(id, meth = nil, &block): End dragging with the left or right mouse button.
-
EvtHandler#evt_tree_begin_label_edit(id, meth = nil, &block): Begin editing a label. This can be prevented by calling NotifyEvent#veto.
-
EvtHandler#evt_tree_end_label_edit(id, meth = nil, &block): Finish editing a label. This can be prevented by calling NotifyEvent#veto.
-
EvtHandler#evt_tree_delete_item(id, meth = nil, &block): Delete an item.
-
EvtHandler#evt_tree_get_info(id, meth = nil, &block): Request information from the application.
-
EvtHandler#evt_tree_set_info(id, meth = nil, &block): Information is being supplied.
-
EvtHandler#evt_tree_item_activated(id, meth = nil, &block): The item has been activated, i.e. chosen by double clicking it with mouse or from keyboard.
-
EvtHandler#evt_tree_item_collapsed(id, meth = nil, &block): The item has been collapsed.
-
EvtHandler#evt_tree_item_collapsing(id, meth = nil, &block): The item is being collapsed. This can be prevented by calling NotifyEvent#veto.
-
EvtHandler#evt_tree_item_expanded(id, meth = nil, &block): The item has been expanded.
-
EvtHandler#evt_tree_item_expanding(id, meth = nil, &block): The item is being expanded. This can be prevented by calling NotifyEvent#veto.
-
EvtHandler#evt_tree_item_right_click(id, meth = nil, &block): The user has clicked the item with the right mouse button.
-
EvtHandler#evt_tree_item_middle_click(id, meth = nil, &block): The user has clicked the item with the middle mouse button.
-
EvtHandler#evt_tree_sel_changed(id, meth = nil, &block): Selection has changed.
-
EvtHandler#evt_tree_sel_changing(id, meth = nil, &block): Selection is changing. This can be prevented by calling NotifyEvent#veto.
-
EvtHandler#evt_tree_key_down(id, meth = nil, &block): A key has been pressed.
-
EvtHandler#evt_tree_item_gettooltip(id, meth = nil, &block): The opportunity to set the item tooltip is being given to the application (call #set_tool_tip). Windows only.
-
EvtHandler#evt_tree_item_menu(id, meth = nil, &block): The context menu for the selected item has been requested, either by a right click or by using the menu key.
-
EvtHandler#evt_tree_state_image_click(id, meth = nil, &block): The state image has been clicked.
Category: Events
Instance Method Summary collapse
-
#get_item ⇒ Wx::TreeItemId
(also: #item)
Returns the item.
-
#get_key_code ⇒ Integer
(also: #key_code)
Returns the key code if the event is a key event.
-
#get_key_event ⇒ Wx::KeyEvent
(also: #key_event)
Returns the key event for EVT_TREE_KEY_DOWN events.
-
#get_label ⇒ Wx::String
(also: #label)
Returns the label if the event is a begin or end edit label event.
-
#get_old_item ⇒ Wx::TreeItemId
(also: #old_item)
Returns the old item index (valid for EVT_TREE_SEL_CHANGING and EVT_TREE_SEL_CHANGED events).
-
#get_point ⇒ Wx::Point
(also: #point)
Returns the position of the mouse pointer if the event is a drag or menu-context event.
-
#initialize(commandType, tree, item = (Wx::TreeItemId.new())) ⇒ Wx::TreeEvent
constructor
Constructor, used by wxWidgets itself only.
-
#is_edit_cancelled ⇒ Boolean
(also: #edit_cancelled?)
Returns true if the label edit was cancelled.
-
#set_tool_tip(tooltip) ⇒ void
(also: #tool_tip=)
Set the tooltip for the item (valid for EVT_TREE_ITEM_GETTOOLTIP events).
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(commandType, tree, item = (Wx::TreeItemId.new())) ⇒ Wx::TreeEvent
Constructor, used by wxWidgets itself only.
71 |
# File 'lib/wx/doc/gen/tree_event.rb', line 71 def initialize(commandType, tree, item=(Wx::TreeItemId.new())) end |
Instance Method Details
#get_item ⇒ Wx::TreeItemId Also known as: item
Returns the item.
Note that the item may be invalid for EVT_TREE_SEL_CHANGED events when the previously selected item has been deselected and there is no new selection any longer, as it notably happens when deleting all tree control items.
77 |
# File 'lib/wx/doc/gen/tree_event.rb', line 77 def get_item; end |
#get_key_code ⇒ Integer Also known as: key_code
Returns the key code if the event is a key event.
Use #get_key_event to get the values of the modifier keys for this event (i.e. Shift or Ctrl).
84 |
# File 'lib/wx/doc/gen/tree_event.rb', line 84 def get_key_code; end |
#get_key_event ⇒ Wx::KeyEvent Also known as: key_event
Returns the key event for EVT_TREE_KEY_DOWN events.
89 |
# File 'lib/wx/doc/gen/tree_event.rb', line 89 def get_key_event; end |
#get_label ⇒ Wx::String Also known as: label
Returns the label if the event is a begin or end edit label event.
94 |
# File 'lib/wx/doc/gen/tree_event.rb', line 94 def get_label; end |
#get_old_item ⇒ Wx::TreeItemId Also known as: old_item
Returns the old item index (valid for EVT_TREE_SEL_CHANGING and EVT_TREE_SEL_CHANGED events).
99 |
# File 'lib/wx/doc/gen/tree_event.rb', line 99 def get_old_item; end |
#get_point ⇒ Wx::Point Also known as: point
Returns the position of the mouse pointer if the event is a drag or menu-context event.
In both cases the position is in client coordinates - i.e. relative to the Wx::TreeCtrl window (so that you can pass it directly to e.g. Window#popup_menu).
106 |
# File 'lib/wx/doc/gen/tree_event.rb', line 106 def get_point; end |
#is_edit_cancelled ⇒ Boolean Also known as: edit_cancelled?
Returns true if the label edit was cancelled.
This should be called from within an EVT_TREE_END_LABEL_EDIT handler.
113 |
# File 'lib/wx/doc/gen/tree_event.rb', line 113 def is_edit_cancelled; end |
#set_tool_tip(tooltip) ⇒ void Also known as: tool_tip=
This method returns an undefined value.
Set the tooltip for the item (valid for EVT_TREE_ITEM_GETTOOLTIP events).
Windows only.
121 |
# File 'lib/wx/doc/gen/tree_event.rb', line 121 def set_tool_tip(tooltip) end |