# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # A tree event holds information about events associated with {Wx::TreeCtrl} objects. # # To process input from a tree control, use these event handler macros to direct input to member functions that take a {Wx::TreeEvent} argument. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::TreeEvent} events. # Event handler methods: # # - {Wx::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 {Wx::TreeEvent#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. # # - {Wx::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 {Wx::TreeEvent#allow}, as it's vetoed by default. # # - {Wx::EvtHandler#evt_tree_end_drag}(id, meth = nil, &block): End dragging with the left or right mouse button. # # - {Wx::EvtHandler#evt_tree_begin_label_edit}(id, meth = nil, &block): Begin editing a label. This can be prevented by calling {Wx::TreeEvent#veto}. # # - {Wx::EvtHandler#evt_tree_end_label_edit}(id, meth = nil, &block): Finish editing a label. This can be prevented by calling {Wx::TreeEvent#veto}. # # - {Wx::EvtHandler#evt_tree_delete_item}(id, meth = nil, &block): Delete an item. # # - {Wx::EvtHandler#evt_tree_get_info}(id, meth = nil, &block): Request information from the application. # # - {Wx::EvtHandler#evt_tree_set_info}(id, meth = nil, &block): Information is being supplied. # # - {Wx::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. # # - {Wx::EvtHandler#evt_tree_item_collapsed}(id, meth = nil, &block): The item has been collapsed. # # - {Wx::EvtHandler#evt_tree_item_collapsing}(id, meth = nil, &block): The item is being collapsed. This can be prevented by calling {Wx::TreeEvent#veto}. # # - {Wx::EvtHandler#evt_tree_item_expanded}(id, meth = nil, &block): The item has been expanded. # # - {Wx::EvtHandler#evt_tree_item_expanding}(id, meth = nil, &block): The item is being expanded. This can be prevented by calling {Wx::TreeEvent#veto}. # # - {Wx::EvtHandler#evt_tree_item_right_click}(id, meth = nil, &block): The user has clicked the item with the right mouse button. # # - {Wx::EvtHandler#evt_tree_item_middle_click}(id, meth = nil, &block): The user has clicked the item with the middle mouse button. # # - {Wx::EvtHandler#evt_tree_sel_changed}(id, meth = nil, &block): Selection has changed. # # - {Wx::EvtHandler#evt_tree_sel_changing}(id, meth = nil, &block): Selection is changing. This can be prevented by calling {Wx::TreeEvent#veto}. # # - {Wx::EvtHandler#evt_tree_key_down}(id, meth = nil, &block): A key has been pressed. # # - {Wx::EvtHandler#evt_tree_item_gettooltip}(id, meth = nil, &block): The opportunity to set the item tooltip is being given to the application (call {Wx::TreeEvent#set_tool_tip}). Windows only. # # - {Wx::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. # # - {Wx::EvtHandler#evt_tree_state_image_click}(id, meth = nil, &block): The state image has been clicked. # # Category: {Wx::Events} # @see Wx::TreeCtrl # # # @wxrb_require USE_TREECTRL class TreeEvent < NotifyEvent # Constructor, used by wxWidgets itself only. # @param commandType [Wx::StaticLine::EventType] # @param tree [Wx::TreeCtrl] # @param item [Wx::TreeItemId] # @return [Wx::TreeEvent] def initialize(commandType, tree, item=(Wx::TreeItemId.new())) end # Returns the item. # # Note that the item may be invalid for {Wx::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. # @return [Wx::TreeItemId] def get_item; end alias_method :item, :get_item # Returns the key code if the event is a key event. # # Use {Wx::TreeEvent#get_key_event} to get the values of the modifier keys for this event (i.e. Shift or Ctrl). # @return [Integer] def get_key_code; end alias_method :key_code, :get_key_code # Returns the key event for EVT_TREE_KEY_DOWN events. # @return [Wx::KeyEvent] def get_key_event; end alias_method :key_event, :get_key_event # Returns the label if the event is a begin or end edit label event. # @return [Wx::String] def get_label; end alias_method :label, :get_label # Returns the old item index (valid for EVT_TREE_SEL_CHANGING and EVT_TREE_SEL_CHANGED events). # @return [Wx::TreeItemId] def get_old_item; end alias_method :old_item, :get_old_item # 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. {Wx::Window#popup_menu}). # @return [Wx::Point] def get_point; end alias_method :point, :get_point # Returns true if the label edit was cancelled. # # This should be called from within an EVT_TREE_END_LABEL_EDIT handler. # @return [Boolean] def is_edit_cancelled; end alias_method :edit_cancelled?, :is_edit_cancelled # Set the tooltip for the item (valid for EVT_TREE_ITEM_GETTOOLTIP events). # # Windows only. # @param tooltip [String] # @return [void] def set_tool_tip(tooltip) end alias_method :tool_tip=, :set_tool_tip end # TreeEvent end