Class: Wx::TreeCtrl
- Includes:
- WithImages
- Defined in:
- lib/wx/doc/gen/tree_ctrl.rb,
lib/wx/doc/tree_ctrl.rb
Overview
A tree control presents information as a hierarchy, with items that may be expanded to show further items.
Items in a tree control are referenced by TreeItemId handles, which may be tested for validity by calling Wx::TreeItemId#is_ok. A similar control with a fully native implementation for GTK+ and macOS as well is DataViewTreeCtrl.
Images in wxTreeCtrl
TreeCtrl inherits from WithImages classes providing the functions for associating images with the control items. Each item refers to its image using an index, which can possibly by WithImages::NO_IMAGE to indicate that the item doesn’t use any image at all, and the corresponding image is taken either from the vector passed to WithImages#set_images or from the image list passed to WithImages#set_image_list or WithImages#assign_image_list functions. In addition to normal images, handled with the methods mentioned above, TreeCtrl also provides optional state images that may be used to indicate some additional state of the item, e.g. checked or unchecked status. These images can be set using #set_state_image_list and assign_state_image_list functions that behave in the same way as the corresponding methods of WithImages. Finally, in the generic version of this control (GenericTreeCtrl), also provides #set_buttons_image_list and assign_buttons_image_list, which can be used to change the images used for the control buttons, used to expand or collapse its branches. These methods are not available in the native WXMSW and Qt implementations.
Events
To intercept events from a tree control, use the event table macros described in TreeEvent.
Styles
This class supports the following styles:
-
TR_EDIT_LABELS: Use this style if you wish the user to be able to edit labels in the tree control.
-
TR_NO_BUTTONS: For convenience to document that no buttons are to be drawn.
-
TR_HAS_BUTTONS: Use this style to show + and - buttons to the left of parent items.
-
TR_TWIST_BUTTONS: Selects alternative style of
+/- buttons
and shows rotating ("twisting") arrows instead. Currently this style is only implemented under Microsoft Windows Vista and later Windows versions and is ignored under the other platforms as enabling it is equivalent to using Wx::SystemThemedControl#enable_system_theme. -
TR_NO_LINES: Use this style to hide vertical level connectors.
-
TR_FULL_ROW_HIGHLIGHT: Use this style to have the background colour and the selection highlight extend over the entire horizontal row of the tree control window. (This flag is ignored under Windows unless you specify TR_NO_LINES as well.)
-
TR_LINES_AT_ROOT: Use this style to show lines leading to the root nodes (unless no TR_NO_LINES is also used, in which case no lines are shown). Note that in the MSW version, if this style is omitted, not only the lines, but also the button used for expanding the root item is not shown, which can be unexpected, so it is recommended to always use it.
-
TR_HIDE_ROOT: Use this style to suppress the display of the root node, effectively causing the first-level nodes to appear as a series of root nodes.
-
TR_ROW_LINES: Use this style to draw a contrasting border between displayed rows.
-
TR_HAS_VARIABLE_ROW_HEIGHT: Use this style to cause row heights to be just big enough to fit the content. If not set, all rows use the largest row height. The default is that this flag is unset. Generic only.
-
TR_SINGLE: For convenience to document that only one item may be selected at a time. Selecting another item causes the current selection, if any, to be deselected. This is the default.
-
TR_MULTIPLE: Use this style to allow a range of items to be selected. If a second range is selected, the current range, if any, is deselected.
-
TR_DEFAULT_STYLE: The set of flags that are closest to the defaults for the native control for a particular toolkit.
Events emitted by this class
The following event-handler methods redirect the events to member method or handler blocks for TreeEvent events. Event handler methods for events emitted by this class:
-
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. Processes a EVT_TREE_BEGIN_DRAG event type.
-
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. Processes a EVT_TREE_BEGIN_RDRAG event type.
-
EvtHandler#evt_tree_end_drag(id, meth = nil, &block): End dragging with the left or right mouse button. Processes a EVT_TREE_END_DRAG event type.
-
EvtHandler#evt_tree_begin_label_edit(id, meth = nil, &block): Begin editing a label. This can be prevented by calling Veto(). Processes a EVT_TREE_BEGIN_LABEL_EDIT event type.
-
EvtHandler#evt_tree_end_label_edit(id, meth = nil, &block): Finish editing a label. This can be prevented by calling Veto(). Processes a EVT_TREE_END_LABEL_EDIT event type.
-
EvtHandler#evt_tree_delete_item(id, meth = nil, &block): An item was deleted. Processes a EVT_TREE_DELETE_ITEM event type.
-
EvtHandler#evt_tree_get_info(id, meth = nil, &block): Request information from the application. Processes a EVT_TREE_GET_INFO event type.
-
EvtHandler#evt_tree_set_info(id, meth = nil, &block): Information is being supplied. Processes a EVT_TREE_SET_INFO event type.
-
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. Processes a EVT_TREE_ITEM_ACTIVATED event type.
-
EvtHandler#evt_tree_item_collapsed(id, meth = nil, &block): The item has been collapsed. Processes a EVT_TREE_ITEM_COLLAPSED event type.
-
EvtHandler#evt_tree_item_collapsing(id, meth = nil, &block): The item is being collapsed. This can be prevented by calling Veto(). Processes a EVT_TREE_ITEM_COLLAPSING event type.
-
EvtHandler#evt_tree_item_expanded(id, meth = nil, &block): The item has been expanded. Processes a EVT_TREE_ITEM_EXPANDED event type.
-
EvtHandler#evt_tree_item_expanding(id, meth = nil, &block): The item is being expanded. This can be prevented by calling Veto(). Processes a EVT_TREE_ITEM_EXPANDING event type.
-
EvtHandler#evt_tree_item_right_click(id, meth = nil, &block): The user has clicked the item with the right mouse button. Processes a EVT_TREE_ITEM_RIGHT_CLICK event type.
-
EvtHandler#evt_tree_item_middle_click(id, meth = nil, &block): The user has clicked the item with the middle mouse button. This is only supported by the generic control. Processes a EVT_TREE_ITEM_MIDDLE_CLICK event type.
-
EvtHandler#evt_tree_sel_changed(id, meth = nil, &block): Selection has changed. Processes a EVT_TREE_SEL_CHANGED event type.
-
EvtHandler#evt_tree_sel_changing(id, meth = nil, &block): Selection is changing. This can be prevented by calling Veto(). Processes a EVT_TREE_SEL_CHANGING event type.
-
EvtHandler#evt_tree_key_down(id, meth = nil, &block): A key has been pressed. Processes a EVT_TREE_KEY_DOWN event type.
-
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. Processes a EVT_TREE_ITEM_GETTOOLTIP event type.
-
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. Notice that these events always carry a valid tree item and so are not generated when (right) clicking outside of the items area. If you need to handle such events, consider using EVT_CONTEXT_MENU instead. Processes a EVT_TREE_ITEM_MENU event type.
-
EvtHandler#evt_tree_state_image_click(id, meth = nil, &block): The state image has been clicked. Processes a EVT_TREE_STATE_IMAGE_CLICK event type.
See also Window Styles.
Category: Controls <div class=‘appearance’><span class=‘appearance’>Appearance:</span><table><tr><td> WXMSW Appearance </td><td> WXGTK Appearance </td><td> WXOSX Appearance </td></tr></table></div>
Instance Method Summary collapse
-
#add_root(text, image = -1,, selImage = -1,, data = nil) ⇒ Wx::TreeItemId
Adds the root node to the tree, returning the new item.
-
#append_item(parent, text, image = -1,, selImage = -1,, data = nil) ⇒ Wx::TreeItemId
Appends an item to the end of the branch identified by parent, return a new item id.
-
#clear_focused_item ⇒ void
Clears the currently focused item.
-
#collapse(item) ⇒ void
Collapses the given item.
-
#collapse_all ⇒ void
Collapses the root item.
-
#collapse_all_children(item) ⇒ void
Collapses this item and all of its children, recursively.
-
#collapse_and_reset(item) ⇒ void
Collapses the given item and removes all children.
-
#create(parent, id = Wx::StandardID::ID_ANY, pos = Wx::DEFAULT_POSITION, size = Wx::DEFAULT_SIZE, style = Wx::TR_DEFAULT_STYLE, validator = Wx::DEFAULT_VALIDATOR, name = Wx::TREE_CTRL_NAME_STR) ⇒ Boolean
Creates the tree control.
-
#delete(item) ⇒ void
Deletes the specified item.
-
#delete_all_items ⇒ void
Deletes all items in the control.
-
#delete_children(item) ⇒ void
Deletes all children of the given item (but not the item itself).
-
#each_item_child(parent_id) {|child_id| ... } ⇒ Object, Enumerator
Iterate all child items of the given parent and yield it’s id to the given block.
-
#edit_label(item_id) ⇒ void
Starts editing the label of the given item.
-
#enable_bell_on_no_match(on = true) ⇒ void
Enable or disable a beep if there is no match for the currently entered text when searching for the item from keyboard.
-
#end_edit_label(item, discardChanges = false) ⇒ void
Ends label editing.
-
#ensure_visible(item) ⇒ void
Scrolls and/or expands items to ensure that the given item is visible.
-
#expand(item) ⇒ void
Expands the given item.
-
#expand_all ⇒ void
Expands all items in the tree.
-
#expand_all_children(item) ⇒ void
Expands the given item and all its children recursively.
-
#get_bounding_rect(item, rect, textOnly = false) ⇒ Boolean
(also: #bounding_rect)
Retrieves the rectangle bounding the item.
-
#get_buttons_image_list ⇒ Wx::ImageList
(also: #buttons_image_list)
Returns the buttons image list (from which application-defined button images are taken).
-
#get_children_count(item, recursively = true) ⇒ Integer
(also: #children_count)
Returns the number of items in the branch.
-
#get_count ⇒ Integer
(also: #count)
Returns the number of items in the control.
-
#get_edit_control ⇒ Wx::TextCtrl
(also: #edit_control)
Returns the edit control being currently used to edit a label.
-
#get_first_child(parent_id) ⇒ Array(Wx::TreeItemId, Object)
Returns the first child; call #get_next_child() for the next child.
-
#get_first_visible_item ⇒ Wx::TreeItemId
(also: #first_visible_item)
Returns the first visible item.
-
#get_focused_item ⇒ Wx::TreeItemId
(also: #focused_item)
Returns the item last clicked or otherwise selected.
-
#get_indent ⇒ Integer
(also: #indent)
Returns the current tree control indentation.
-
#get_item_background_colour(item) ⇒ Wx::Colour
(also: #item_background_colour)
Returns the background colour of the item.
-
#get_item_children(parent_id) ⇒ Array<Wx::TreeItemId>
(also: #item_children)
Returns an array of tree item ids of the child items of the given parent.
-
#get_item_data(item) ⇒ Object
(also: #item_data)
Returns the tree item data associated with the item.
-
#get_item_font(item) ⇒ Wx::Font
(also: #item_font)
Returns the font of the item label.
-
#get_item_image(item, which = Wx::TreeItemIcon::TreeItemIcon_Normal) ⇒ Integer
(also: #item_image)
Gets the specified item image.
-
#get_item_parent(item) ⇒ Wx::TreeItemId
(also: #item_parent)
Returns the item’s parent.
-
#get_item_state(item) ⇒ Integer
(also: #item_state)
Gets the specified item state.
-
#get_item_text(item) ⇒ String
(also: #item_text)
Returns the item label.
-
#get_item_text_colour(item) ⇒ Wx::Colour
(also: #item_text_colour)
Returns the colour of the item label.
-
#get_last_child(item) ⇒ Wx::TreeItemId
(also: #last_child)
Returns the last child of the item (or an invalid tree item if this item has no children).
-
#get_next_child(parent_id, cookie) ⇒ Array(Wx::TreeItemId, Object)
Returns the next child; call #get_first_child() for the first child.
-
#get_next_sibling(item) ⇒ Wx::TreeItemId
(also: #next_sibling)
Returns the next sibling of the specified item; call #get_prev_sibling for the previous sibling.
-
#get_next_visible(item) ⇒ Wx::TreeItemId
(also: #next_visible)
Returns the next visible item or an invalid item if this item is the last visible one.
-
#get_prev_sibling(item) ⇒ Wx::TreeItemId
(also: #prev_sibling)
Returns the previous sibling of the specified item; call #get_next_sibling for the next sibling.
-
#get_prev_visible(item) ⇒ Wx::TreeItemId
(also: #prev_visible)
Returns the previous visible item or an invalid item if this item is the first visible one.
-
#get_quick_best_size ⇒ Boolean
(also: #quick_best_size)
Returns true if the control will use a quick calculation for the best size, looking only at the first and last items.
-
#get_root_item ⇒ Wx::TreeItemId
(also: #root_item)
Returns the root item for the tree control.
-
#get_root_items ⇒ Array<Wx::TreeItemId>
Returns an array of tree item ids of the current child items of the root.
-
#get_selection ⇒ Wx::TreeItemId
(also: #selection)
Returns the selection, or an invalid item if there is no selection.
-
#get_selections ⇒ Array<Wx::TreeItemId>
Returns an array of tree item ids of the currently selected items.
-
#get_spacing ⇒ Integer
(also: #spacing)
Returns the current tree control spacing.
-
#get_state_image_list ⇒ Wx::ImageList
(also: #state_image_list)
Returns the state image list (from which application-defined state images are taken).
-
#hit_test(point) ⇒ Array(Wx::TreeItemId,Integer)
Calculates which (if any) item is under the given point, returning the tree item id at this point plus extra information flags.
-
#initialize(*args) ⇒ TreeCtrl
constructor
A new instance of TreeCtrl.
-
#insert_item(parent, previous, text, image = -1,, selImage = -1,, data = nil) ⇒ Wx::TreeItemId
Inserts an item after a given one (previous).
-
#insert_item_before(parent, pos, text, image = -1,, selImage = -1,, data = nil) ⇒ Wx::TreeItemId
Inserts an item before one identified by its position (pos).
-
#is_bold(item) ⇒ Boolean
(also: #bold?)
Returns true if the given item is in bold state.
-
#is_empty ⇒ Boolean
(also: #empty?)
Returns true if the control is empty (i.e. has no items, even no root one).
-
#is_expanded(item) ⇒ Boolean
(also: #expanded?)
Returns true if the item is expanded (only makes sense if it has children).
-
#is_selected(item) ⇒ Boolean
(also: #selected?)
Returns true if the item is selected.
-
#is_visible(item) ⇒ Boolean
(also: #visible?)
Returns true if the item is visible on the screen.
-
#item_has_children(item) ⇒ Boolean
Returns true if the item has children.
-
#on_compare_items(item1, item2) ⇒ Integer
Override this function in the derived class to change the sort order of the items in the tree control.
-
#prepend_item(parent, text, image = -1,, selImage = -1,, data = nil) ⇒ Wx::TreeItemId
Appends an item as the first child of parent, return a new item id.
-
#scroll_to(item) ⇒ void
Scrolls the specified item into view.
-
#select_children(parent) ⇒ void
Select all the immediate children of the given parent.
-
#select_item(item, select = true) ⇒ void
Selects the given item.
-
#set_buttons_image_list(imageList) ⇒ void
(also: #buttons_image_list=)
Sets the buttons image list (from which application-defined button images are taken).
-
#set_focused_item(item) ⇒ void
(also: #focused_item=)
Sets the currently focused item.
-
#set_indent(indent) ⇒ void
(also: #indent=)
Sets the indentation for the tree control.
-
#set_item_background_colour(item, col) ⇒ void
Sets the colour of the item’s background.
-
#set_item_bold(item, bold = true) ⇒ void
(also: #item_bold=)
Makes item appear in bold font if bold parameter is true or resets it to the normal state.
-
#set_item_data(item, data) ⇒ void
Sets the item client data.
-
#set_item_drop_highlight(item, highlight = true) ⇒ void
(also: #item_drop_highlight=)
Gives the item the visual feedback for Drag’n’Drop actions, which is useful if something is dragged from the outside onto the tree control (as opposed to a DnD operation within the tree control, which already is implemented internally).
-
#set_item_font(item, font) ⇒ void
Sets the item’s font.
-
#set_item_has_children(item, hasChildren = true) ⇒ void
(also: #item_has_children=)
Force appearance of the button next to the item.
-
#set_item_image(item, image, which = Wx::TreeItemIcon::TreeItemIcon_Normal) ⇒ void
Sets the specified item’s image.
-
#set_item_state(item, state) ⇒ void
Sets the specified item state.
-
#set_item_text(item, text) ⇒ void
Sets the item label.
-
#set_item_text_colour(item, col) ⇒ void
Sets the colour of the item’s text.
-
#set_quick_best_size(quickBestSize) ⇒ void
(also: #quick_best_size=)
If true is passed, specifies that the control will use a quick calculation for the best size, looking only at the first and last items.
-
#set_spacing(spacing) ⇒ void
(also: #spacing=)
Sets the spacing for the tree control.
-
#set_state_image_list(imageList) ⇒ void
(also: #state_image_list=)
Sets the state image list (from which application-defined state images are taken).
-
#set_window_style(styles) ⇒ void
(also: #window_style=)
Sets the mode flags associated with the display of the tree control.
-
#sort_children(item) ⇒ void
Sorts the children of the given item using #on_compare_items.
-
#toggle(item) ⇒ void
Toggles the given item between collapsed and expanded states.
-
#toggle_item_selection(item) ⇒ void
Toggles the given item between selected and unselected states.
-
#traverse(start_id = nil) {|child_id| ... } ⇒ Object, Enumerator
(also: #each)
Yield each tree item id (recursively) to the given block.
-
#unselect ⇒ void
Removes the selection from the currently selected item (if any).
-
#unselect_all ⇒ void
This function either behaves the same as #unselect if the control doesn’t have TR_MULTIPLE style, or removes the selection from all items if it does have this style.
-
#unselect_item(item) ⇒ void
Unselects the given item.
Methods included from WithImages
#get_image_count, #get_image_list, #get_updated_image_list_for, #has_images, #set_image_list, #set_images
Methods inherited from Control
#command, ellipsize, escape_mnemonics, #get_label, #get_label_text, #get_size_from_text, #get_size_from_text_size, remove_mnemonics, #set_label, #set_label_markup, #set_label_text
Methods inherited from Window
#accepts_focus, #accepts_focus_from_keyboard, #accepts_focus_recursively, #add_child, #adjust_for_layout_direction, #always_show_scrollbars, #begin_repositioning_children, #cache_best_size, #can_accept_focus, #can_accept_focus_from_keyboard, #can_scroll, #can_set_transparent, #capture_mouse, #center, #center_on_parent, #centre, #centre_on_parent, #clear_background, #client_to_screen, #client_to_window_size, #close, #convert_dialog_to_pixels, #convert_pixels_to_dialog, #destroy, #destroy_children, #disable, #disable_focus_from_keyboard, #do_update_window_ui, #drag_accept_files, #each_child, #enable, #enable_touch_events, #enable_visible_focus, #end_repositioning_children, find_focus, #find_window_by_id, find_window_by_id, #find_window_by_label, find_window_by_label, #find_window_by_name, find_window_by_name, #fit, #fit_inside, #freeze, #from_dip, from_dip, #from_phys, from_phys, #get_accelerator_table, #get_auto_layout, #get_background_colour, #get_background_style, #get_best_height, #get_best_size, #get_best_virtual_size, #get_best_width, #get_border, get_capture, #get_caret, #get_char_height, #get_char_width, #get_children, get_class_default_attributes, #get_client_area_origin, #get_client_rect, #get_client_size, #get_containing_sizer, #get_content_scale_factor, #get_cursor, #get_default_attributes, #get_dpi, #get_dpi_scale_factor, #get_drop_target, #get_effective_min_size, #get_event_handler, #get_extra_style, #get_font, #get_foreground_colour, #get_grand_parent, #get_help_text, #get_help_text_at_point, #get_id, #get_label, #get_layout_direction, #get_max_client_size, #get_max_height, #get_max_size, #get_max_width, #get_min_client_size, #get_min_height, #get_min_size, #get_min_width, #get_name, #get_parent, #get_popup_menu_selection_from_user, #get_position, #get_rect, #get_screen_position, #get_screen_rect, #get_scroll_pos, #get_scroll_range, #get_scroll_thumb, #get_size, #get_sizer, #get_text_extent, #get_theme_enabled, #get_tool_tip, #get_tool_tip_text, #get_update_client_rect, #get_update_region, #get_validator, #get_virtual_size, #get_window_border_size, #get_window_style, #get_window_style_flag, #get_window_variant, #handle_as_navigation_key, #handle_window_event, #has_capture, #has_extra_style, #has_flag, #has_focus, #has_multiple_pages, #has_scrollbar, #has_transparent_background, #hide, #hide_with_effect, #inform_first_direction, #inherit_attributes, #inherits_background_colour, #inherits_foreground_colour, #init_dialog, #invalidate_best_size, #is_being_deleted, #is_descendant, #is_double_buffered, #is_enabled, #is_exposed, #is_focusable, #is_frozen, #is_retained, #is_scrollbar_always_shown, #is_shown, #is_shown_on_screen, #is_this_enabled, #is_top_level, #is_transparent_background_supported, #layout, #line_down, #line_up, #locked, #lower_window, #move, #move_after_in_tab_order, #move_before_in_tab_order, #navigate, #navigate_in, new_control_id, #on_internal_idle, #page_down, #page_up, #paint, #paint_buffered, #popup_menu, #post_size_event, #post_size_event_to_parent, #process_window_event, #process_window_event_locally, #push_event_handler, #raise_window, #refresh, #refresh_rect, #register_hot_key, #release_mouse, #remove_child, #remove_event_handler, #reparent, #screen_to_client, #scroll_lines, #scroll_pages, #scroll_window, #send_size_event, #send_size_event_to_parent, #set_accelerator_table, #set_auto_layout, #set_background_colour, #set_background_style, #set_can_focus, #set_caret, #set_client_size, #set_containing_sizer, #set_cursor, #set_double_buffered, #set_drop_target, #set_event_handler, #set_extra_style, #set_focus, #set_focus_from_kbd, #set_font, #set_foreground_colour, #set_help_text, #set_id, #set_initial_size, #set_label, #set_layout_direction, #set_max_client_size, #set_max_size, #set_min_client_size, #set_min_size, #set_name, #set_next_handler, #set_own_background_colour, #set_own_font, #set_own_foreground_colour, #set_position, #set_previous_handler, #set_scroll_pos, #set_scrollbar, #set_size, #set_size_hints, #set_sizer, #set_sizer_and_fit, #set_theme_enabled, #set_tool_tip, #set_transparent, #set_validator, #set_virtual_size, #set_window_style_flag, #set_window_variant, #should_inherit_colours, #show, #show_with_effect, #switch_sizer, #thaw, #to_dip, to_dip, #to_phys, to_phys, #toggle_window_style, #transfer_data_from_window, #transfer_data_to_window, #unregister_hot_key, unreserve_control_id, #unset_tool_tip, #update, #update_window_ui, #use_background_colour, #use_bg_col, #use_foreground_colour, #validate, #warp_pointer, #window_to_client_size
Methods inherited from EvtHandler
add_filter, #add_pending_event, #call_after, clear_filters, #connect, #delete_pending_events, #disconnect, #evt_activate, #evt_activate_app, #evt_aui_pane_activated, #evt_aui_pane_button, #evt_aui_pane_close, #evt_aui_pane_maximize, #evt_aui_pane_restore, #evt_aui_render, #evt_auinotebook_allow_dnd, #evt_auinotebook_begin_drag, #evt_auinotebook_bg_dclick, #evt_auinotebook_button, #evt_auinotebook_drag_done, #evt_auinotebook_drag_motion, #evt_auinotebook_end_drag, #evt_auinotebook_page_changed, #evt_auinotebook_page_changing, #evt_auinotebook_page_close, #evt_auinotebook_page_closed, #evt_auinotebook_tab_middle_down, #evt_auinotebook_tab_middle_up, #evt_auinotebook_tab_right_down, #evt_auinotebook_tab_right_up, #evt_auitoolbar_begin_drag, #evt_auitoolbar_middle_click, #evt_auitoolbar_overflow_click, #evt_auitoolbar_right_click, #evt_auitoolbar_tool_dropdown, #evt_button, #evt_calculate_layout, #evt_calendar, #evt_calendar_page_changed, #evt_calendar_sel_changed, #evt_calendar_week_clicked, #evt_calendar_weekday_clicked, #evt_char, #evt_char_hook, #evt_checkbox, #evt_checklistbox, #evt_child_focus, #evt_choice, #evt_choicebook_page_changed, #evt_choicebook_page_changing, #evt_close, #evt_collapsiblepane_changed, #evt_colourpicker_changed, #evt_colourpicker_current_changed, #evt_colourpicker_dialog_cancelled, #evt_combobox, #evt_combobox_closeup, #evt_combobox_dropdown, #evt_command, #evt_command_enter, #evt_command_kill_focus, #evt_command_left_click, #evt_command_left_dclick, #evt_command_range, #evt_command_right_click, #evt_command_scroll, #evt_command_scroll_bottom, #evt_command_scroll_changed, #evt_command_scroll_linedown, #evt_command_scroll_lineup, #evt_command_scroll_pagedown, #evt_command_scroll_pageup, #evt_command_scroll_thumbrelease, #evt_command_scroll_thumbtrack, #evt_command_scroll_top, #evt_command_set_focus, #evt_context_menu, #evt_date_changed, #evt_dialup_connected, #evt_dialup_disconnected, #evt_dirctrl_fileactivated, #evt_dirctrl_selectionchanged, #evt_dirpicker_changed, #evt_display_changed, #evt_dpi_changed, #evt_drop_files, #evt_end_session, #evt_enter_window, #evt_erase_background, #evt_filectrl_fileactivated, #evt_filectrl_filterchanged, #evt_filectrl_folderchanged, #evt_filectrl_selectionchanged, #evt_filepicker_changed, #evt_find, #evt_find_close, #evt_find_next, #evt_find_replace, #evt_find_replace_all, #evt_fontpicker_changed, #evt_fullscreen, #evt_gesture_pan, #evt_gesture_rotate, #evt_gesture_zoom, #evt_grid_cell_changed, #evt_grid_cell_changing, #evt_grid_cell_left_click, #evt_grid_cell_left_dclick, #evt_grid_cell_right_click, #evt_grid_cell_right_dclick, #evt_grid_cmd_col_size, #evt_grid_cmd_editor_created, #evt_grid_cmd_range_selected, #evt_grid_cmd_range_selecting, #evt_grid_cmd_row_size, #evt_grid_col_auto_size, #evt_grid_col_move, #evt_grid_col_size, #evt_grid_col_sort, #evt_grid_editor_created, #evt_grid_editor_hidden, #evt_grid_editor_shown, #evt_grid_label_left_click, #evt_grid_label_left_dclick, #evt_grid_label_right_click, #evt_grid_label_right_dclick, #evt_grid_range_selected, #evt_grid_range_selecting, #evt_grid_row_auto_size, #evt_grid_row_move, #evt_grid_row_size, #evt_grid_select_cell, #evt_grid_tabbing, #evt_header_begin_reorder, #evt_header_begin_resize, #evt_header_click, #evt_header_dclick, #evt_header_dragging_cancelled, #evt_header_end_reorder, #evt_header_end_resize, #evt_header_middle_click, #evt_header_middle_dclick, #evt_header_resizing, #evt_header_right_click, #evt_header_right_dclick, #evt_header_separator_dclick, #evt_help, #evt_help_range, #evt_hibernate, #evt_hotkey, #evt_html_cell_clicked, #evt_html_cell_hover, #evt_html_link_clicked, #evt_hyperlink, #evt_iconize, #evt_idle, #evt_init_dialog, #evt_joy_button_down, #evt_joy_button_up, #evt_joy_move, #evt_joy_zmove, #evt_joystick_events, #evt_key_down, #evt_key_up, #evt_kill_focus, #evt_leave_window, #evt_left_dclick, #evt_left_down, #evt_left_up, #evt_list_begin_drag, #evt_list_begin_label_edit, #evt_list_begin_rdrag, #evt_list_cache_hint, #evt_list_col_begin_drag, #evt_list_col_click, #evt_list_col_dragging, #evt_list_col_end_drag, #evt_list_col_right_click, #evt_list_delete_all_items, #evt_list_delete_item, #evt_list_end_label_edit, #evt_list_insert_item, #evt_list_item_activated, #evt_list_item_checked, #evt_list_item_deselected, #evt_list_item_focused, #evt_list_item_middle_click, #evt_list_item_right_click, #evt_list_item_selected, #evt_list_item_unchecked, #evt_list_key_down, #evt_listbook_page_changed, #evt_listbook_page_changing, #evt_listbox, #evt_listbox_dclick, #evt_long_press, #evt_magnify, #evt_maximize, #evt_media_finished, #evt_media_loaded, #evt_media_pause, #evt_media_play, #evt_media_statechanged, #evt_media_stop, #evt_menu, #evt_menu_close, #evt_menu_highlight, #evt_menu_highlight_all, #evt_menu_open, #evt_menu_range, #evt_middle_dclick, #evt_middle_down, #evt_middle_up, #evt_motion, #evt_mouse_aux1_dclick, #evt_mouse_aux1_down, #evt_mouse_aux1_up, #evt_mouse_aux2_dclick, #evt_mouse_aux2_down, #evt_mouse_aux2_up, #evt_mouse_capture_changed, #evt_mouse_capture_lost, #evt_mouse_events, #evt_mousewheel, #evt_move, #evt_move_end, #evt_move_start, #evt_moving, #evt_navigation_key, #evt_notebook_page_changed, #evt_notebook_page_changing, #evt_paint, #evt_pg_changed, #evt_pg_changing, #evt_pg_col_begin_drag, #evt_pg_col_dragging, #evt_pg_col_end_drag, #evt_pg_double_click, #evt_pg_highlighted, #evt_pg_item_collapsed, #evt_pg_item_expanded, #evt_pg_label_edit_begin, #evt_pg_label_edit_ending, #evt_pg_page_changed, #evt_pg_right_click, #evt_pg_selected, #evt_press_and_tap, #evt_query_end_session, #evt_query_layout_info, #evt_radiobox, #evt_radiobutton, #evt_ribbonbar_help_click, #evt_ribbonbar_page_changed, #evt_ribbonbar_page_changing, #evt_ribbonbar_tab_left_dclick, #evt_ribbonbar_tab_middle_down, #evt_ribbonbar_tab_middle_up, #evt_ribbonbar_tab_right_down, #evt_ribbonbar_tab_right_up, #evt_ribbonbar_toggled, #evt_ribbonbuttonbar_clicked, #evt_ribbonbuttonbar_dropdown_clicked, #evt_ribbongallery_clicked, #evt_ribbongallery_hover_changed, #evt_ribbongallery_selected, #evt_ribbonpanel_extbutton_activated, #evt_ribbontoolbar_clicked, #evt_ribbontoolbar_dropdown_clicked, #evt_richtext_buffer_reset, #evt_richtext_character, #evt_richtext_consuming_character, #evt_richtext_content_deleted, #evt_richtext_content_inserted, #evt_richtext_delete, #evt_richtext_focus_object_changed, #evt_richtext_left_click, #evt_richtext_left_dclick, #evt_richtext_middle_click, #evt_richtext_properties_changed, #evt_richtext_return, #evt_richtext_right_click, #evt_richtext_selection_changed, #evt_richtext_style_changed, #evt_richtext_stylesheet_changed, #evt_richtext_stylesheet_replaced, #evt_richtext_stylesheet_replacing, #evt_right_dclick, #evt_right_down, #evt_right_up, #evt_sash_dragged, #evt_sash_dragged_range, #evt_scroll, #evt_scroll_bottom, #evt_scroll_changed, #evt_scroll_command, #evt_scroll_linedown, #evt_scroll_lineup, #evt_scroll_pagedown, #evt_scroll_pageup, #evt_scroll_thumbrelease, #evt_scroll_thumbtrack, #evt_scroll_top, #evt_scrollbar, #evt_scrollwin, #evt_scrollwin_bottom, #evt_scrollwin_linedown, #evt_scrollwin_lineup, #evt_scrollwin_pagedown, #evt_scrollwin_pageup, #evt_scrollwin_thumbrelease, #evt_scrollwin_thumbtrack, #evt_scrollwin_top, #evt_search, #evt_search_cancel, #evt_set_cursor, #evt_set_focus, #evt_show, #evt_size, #evt_slider, #evt_spin, #evt_spin_down, #evt_spin_up, #evt_spinctrl, #evt_spinctrldouble, #evt_splitter_dclick, #evt_splitter_sash_pos_changed, #evt_splitter_sash_pos_changing, #evt_splitter_sash_pos_resize, #evt_splitter_unsplit, #evt_stc_autocomp_cancelled, #evt_stc_autocomp_char_deleted, #evt_stc_autocomp_completed, #evt_stc_autocomp_selection, #evt_stc_autocomp_selection_change, #evt_stc_calltip_click, #evt_stc_change, #evt_stc_charadded, #evt_stc_clipboard_copy, #evt_stc_clipboard_paste, #evt_stc_do_drop, #evt_stc_doubleclick, #evt_stc_drag_over, #evt_stc_dwellend, #evt_stc_dwellstart, #evt_stc_hotspot_click, #evt_stc_hotspot_dclick, #evt_stc_hotspot_release_click, #evt_stc_indicator_click, #evt_stc_indicator_release, #evt_stc_macrorecord, #evt_stc_margin_right_click, #evt_stc_marginclick, #evt_stc_modified, #evt_stc_needshown, #evt_stc_painted, #evt_stc_romodifyattempt, #evt_stc_savepointleft, #evt_stc_savepointreached, #evt_stc_start_drag, #evt_stc_styleneeded, #evt_stc_updateui, #evt_stc_userlistselection, #evt_stc_zoom, #evt_sys_colour_changed, #evt_taskbar_click, #evt_taskbar_left_dclick, #evt_taskbar_left_down, #evt_taskbar_left_up, #evt_taskbar_move, #evt_taskbar_right_dclick, #evt_taskbar_right_down, #evt_taskbar_right_up, #evt_text, #evt_text_copy, #evt_text_cut, #evt_text_enter, #evt_text_maxlen, #evt_text_paste, #evt_text_url, #evt_time_changed, #evt_timer, #evt_togglebutton, #evt_tool, #evt_tool_dropdown, #evt_tool_enter, #evt_tool_range, #evt_tool_rclicked, #evt_tool_rclicked_range, #evt_toolbook_page_changed, #evt_toolbook_page_changing, #evt_tree_begin_drag, #evt_tree_begin_label_edit, #evt_tree_begin_rdrag, #evt_tree_delete_item, #evt_tree_end_drag, #evt_tree_end_label_edit, #evt_tree_get_info, #evt_tree_item_activated, #evt_tree_item_collapsed, #evt_tree_item_collapsing, #evt_tree_item_expanded, #evt_tree_item_expanding, #evt_tree_item_gettooltip, #evt_tree_item_menu, #evt_tree_item_middle_click, #evt_tree_item_right_click, #evt_tree_key_down, #evt_tree_sel_changed, #evt_tree_sel_changing, #evt_tree_set_info, #evt_tree_state_image_click, #evt_treebook_node_collapsed, #evt_treebook_node_expanded, #evt_treebook_page_changed, #evt_treebook_page_changing, #evt_two_finger_tap, #evt_update_ui, #evt_update_ui_range, #evt_window_create, #evt_window_destroy, #evt_wizard_before_page_changed, #evt_wizard_cancel, #evt_wizard_finished, #evt_wizard_help, #evt_wizard_page_changed, #evt_wizard_page_changing, #evt_wizard_page_shown, #get_client_object, #get_evt_handler_enabled, #get_next_handler, #get_previous_handler, #is_unlinked, #process_event, #process_event_locally, #process_pending_events, #queue_event, register_class, remove_filter, #safely_process_event, #set_client_object, #set_evt_handler_enabled, #set_next_handler, #set_previous_handler, #try_after, #try_before, #unlink
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize ⇒ Wx::TreeCtrl #initialize(parent, id = Wx::StandardID::ID_ANY, pos = Wx::DEFAULT_POSITION, size = Wx::DEFAULT_SIZE, style = Wx::TR_DEFAULT_STYLE, validator = Wx::DEFAULT_VALIDATOR, name = Wx::TREE_CTRL_NAME_STR) ⇒ Wx::TreeCtrl
Returns a new instance of TreeCtrl.
360 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 360 def initialize(*args) end |
Instance Method Details
#add_root(text, image = -1,, selImage = -1,, data = nil) ⇒ Wx::TreeItemId
Adds the root node to the tree, returning the new item.
The image and selImage parameters are an index within the normal image list specifying the image to use for unselected and selected items, respectively. If image > -1 and selImage is -1, the same image is used for both selected and unselected items.
370 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 370 def add_root(text, image=-1, selImage=-1, data=nil) end |
#append_item(parent, text, image = -1,, selImage = -1,, data = nil) ⇒ Wx::TreeItemId
Appends an item to the end of the branch identified by parent, return a new item id.
The image and selImage parameters are an index within the normal image list specifying the image to use for unselected and selected items, respectively. If image > -1 and selImage is -1, the same image is used for both selected and unselected items.
381 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 381 def append_item(parent, text, image=-1, selImage=-1, data=nil) end |
#clear_focused_item ⇒ void
This method returns an undefined value.
Clears the currently focused item.
547 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 547 def clear_focused_item; end |
#collapse(item) ⇒ void
This method returns an undefined value.
Collapses the given item.
386 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 386 def collapse(item) end |
#collapse_all ⇒ void
This method returns an undefined value.
Collapses the root item.
393 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 393 def collapse_all; end |
#collapse_all_children(item) ⇒ void
This method returns an undefined value.
Collapses this item and all of its children, recursively.
401 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 401 def collapse_all_children(item) end |
#collapse_and_reset(item) ⇒ void
This method returns an undefined value.
Collapses the given item and removes all children.
406 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 406 def collapse_and_reset(item) end |
#create(parent, id = Wx::StandardID::ID_ANY, pos = Wx::DEFAULT_POSITION, size = Wx::DEFAULT_SIZE, style = Wx::TR_DEFAULT_STYLE, validator = Wx::DEFAULT_VALIDATOR, name = Wx::TREE_CTRL_NAME_STR) ⇒ Boolean
Creates the tree control.
See #initialize for further details.
419 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 419 def create(parent, id=Wx::StandardID::ID_ANY, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::TR_DEFAULT_STYLE, validator=Wx::DEFAULT_VALIDATOR, name=Wx::TREE_CTRL_NAME_STR) end |
#delete(item) ⇒ void
This method returns an undefined value.
Deletes the specified item.
A EVT_TREE_DELETE_ITEM event will be generated. This function may cause a subsequent call to #get_next_child to fail.
427 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 427 def delete(item) end |
#delete_all_items ⇒ void
This method returns an undefined value.
Deletes all items in the control.
This function generates EVT_TREE_DELETE_ITEM events for each item being deleted, including the root one if it is shown, i.e. unless Wx::TR_HIDE_ROOT style is used.
433 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 433 def delete_all_items; end |
#delete_children(item) ⇒ void
This method returns an undefined value.
Deletes all children of the given item (but not the item itself).
A EVT_TREE_DELETE_ITEM event will be generated for every item being deleted. If you have called #set_item_has_children, you may need to call it again since #delete_children does not automatically clear the setting.
441 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 441 def delete_children(item) end |
#each_item_child(parent_id) {|child_id| ... } ⇒ Object, Enumerator
Iterate all child items of the given parent and yield it’s id to the given block. Returns an Enumerator if no block given.
49 |
# File 'lib/wx/doc/tree_ctrl.rb', line 49 def each_item_child(parent_id) end |
#edit_label(item_id) ⇒ void
This method returns an undefined value.
Starts editing the label of the given item. This function generates a EVT_TREE_BEGIN_LABEL_EDIT event which can be vetoed to prevent the editing from starting. If it does start, a text control, which can be retrieved using GetEditControl(), allowing the user to edit the label interactively is shown. When the editing ends, EVT_TREE_END_LABEL_EDIT event is sent and this event can be vetoed as well to prevent the label from changing. Note that this event is sent both when the user accepts (e.g. by pressing Enter) or cancels (e.g. by pressing Escape) and its handler can use wxTreeEvent::IsEditCancelled() to distinguish between these situations.
91 |
# File 'lib/wx/doc/tree_ctrl.rb', line 91 def edit_label(item_id) end |
#enable_bell_on_no_match(on = true) ⇒ void
This method returns an undefined value.
Enable or disable a beep if there is no match for the currently entered text when searching for the item from keyboard.
The default is to not beep in this case except in WXMSW where the beep is always generated by the native control and cannot be disabled, i.e. calls to this function do nothing there.
448 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 448 def enable_bell_on_no_match(on=true) end |
#end_edit_label(item, discardChanges = false) ⇒ void
This method returns an undefined value.
Ends label editing.
If cancelEdit is true, the edit will be cancelled.
This function is currently supported under Windows only.
463 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 463 def end_edit_label(item, discardChanges=false) end |
#ensure_visible(item) ⇒ void
This method returns an undefined value.
Scrolls and/or expands items to ensure that the given item is visible.
This method can be used, and will work, even while the window is frozen (see Window#freeze).
470 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 470 def ensure_visible(item) end |
#expand(item) ⇒ void
This method returns an undefined value.
Expands the given item.
475 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 475 def (item) end |
#expand_all ⇒ void
This method returns an undefined value.
Expands all items in the tree.
479 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 479 def ; end |
#expand_all_children(item) ⇒ void
This method returns an undefined value.
Expands the given item and all its children recursively.
484 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 484 def (item) end |
#get_bounding_rect(item, rect, textOnly = false) ⇒ Boolean Also known as: bounding_rect
Retrieves the rectangle bounding the item.
If textOnly is true, only the rectangle around the item’s label will be returned, otherwise the item’s image is also taken into account. The return value is true if the rectangle was successfully retrieved or false if it was not (in this case rect is not changed) for example, if the item is currently invisible. Notice that the rectangle coordinates are logical, not physical ones. So, for example, the x coordinate may be negative if the tree has a horizontal scrollbar and its position is not 0.
495 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 495 def get_bounding_rect(item, rect, textOnly=false) end |
#get_buttons_image_list ⇒ Wx::ImageList Also known as:
Returns the buttons image list (from which application-defined button images are taken).
This function is only available in the generic version.
503 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 503 def ; end |
#get_children_count(item, recursively = true) ⇒ Integer Also known as: children_count
Returns the number of items in the branch.
If recursively is true, returns the total number of descendants, otherwise only one level of children is counted.
512 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 512 def get_children_count(item, recursively=true) end |
#get_count ⇒ Integer Also known as: count
Returns the number of items in the control.
517 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 517 def get_count; end |
#get_edit_control ⇒ Wx::TextCtrl Also known as: edit_control
Returns the edit control being currently used to edit a label.
Returns NULL if no label is being edited.
This is currently only implemented for WXMSW.
530 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 530 def get_edit_control; end |
#get_first_child(parent_id) ⇒ Array(Wx::TreeItemId, Object)
Returns the first child; call #get_next_child() for the next child. For this enumeration method a ‘cookie’ is returned which is opaque for the application but is necessary for the library to make these methods reentrant (i.e. allow more than one enumeration on one and the same object simultaneously). The cookie returned from (and passed to) #get_first_child() and #get_next_child() should be the same variable.
Returns an invalid tree item (i.e. Wx::TreeItemId#ok? returns false) if there are no further children.
30 |
# File 'lib/wx/doc/tree_ctrl.rb', line 30 def get_first_child(parent_id) end |
#get_first_visible_item ⇒ Wx::TreeItemId Also known as: first_visible_item
Returns the first visible item.
535 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 535 def get_first_visible_item; end |
#get_focused_item ⇒ Wx::TreeItemId Also known as: focused_item
Returns the item last clicked or otherwise selected.
Unlike #get_selection, it can be used whether or not the control has the Wx::TR_MULTIPLE style.
542 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 542 def get_focused_item; end |
#get_indent ⇒ Integer Also known as: indent
Returns the current tree control indentation.
557 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 557 def get_indent; end |
#get_item_background_colour(item) ⇒ Wx::Colour Also known as: item_background_colour
Returns the background colour of the item.
570 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 570 def get_item_background_colour(item) end |
#get_item_children(parent_id) ⇒ Array<Wx::TreeItemId> Also known as: item_children
Returns an array of tree item ids of the child items of the given parent.
54 |
# File 'lib/wx/doc/tree_ctrl.rb', line 54 def get_item_children(parent_id) end |
#get_item_data(item) ⇒ Object Also known as: item_data
Returns the tree item data associated with the item.
-
GetPlData(item): returns the Perl data associated with the Wx::TreeItemData. It is just the same as tree->GetItemData(item)->GetData().
579 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 579 def get_item_data(item) end |
#get_item_font(item) ⇒ Wx::Font Also known as: item_font
Returns the font of the item label.
If the font hadn’t been explicitly set for the specified item with #set_item_font, returns an invalid NULL_FONT font. Window#get_font can be used to retrieve the global tree control font used for the items without any specific font.
587 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 587 def get_item_font(item) end |
#get_item_image(item, which = Wx::TreeItemIcon::TreeItemIcon_Normal) ⇒ Integer Also known as: item_image
Gets the specified item image.
The value of which may be:
-
Wx::TreeItemIcon::TreeItemIcon_Normal: to get the normal item image.
-
Wx::TreeItemIcon::TreeItemIcon_Selected: to get the selected item image (i.e. the image which is shown when the item is currently selected).
-
Wx::TreeItemIcon::TreeItemIcon_Expanded: to get the expanded image (this only makes sense for items which have children - then this image is shown when the item is expanded and the normal image is shown when it is collapsed).
-
Wx::TreeItemIcon::TreeItemIcon_SelectedExpanded: to get the selected expanded image (which is shown when an expanded item is currently selected).
601 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 601 def get_item_image(item, which=Wx::TreeItemIcon::TreeItemIcon_Normal) end |
#get_item_parent(item) ⇒ Wx::TreeItemId Also known as: item_parent
Returns the item’s parent.
607 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 607 def get_item_parent(item) end |
#get_item_state(item) ⇒ Integer Also known as: item_state
Gets the specified item state.
613 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 613 def get_item_state(item) end |
#get_item_text(item) ⇒ String Also known as: item_text
Returns the item label.
619 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 619 def get_item_text(item) end |
#get_item_text_colour(item) ⇒ Wx::Colour Also known as: item_text_colour
Returns the colour of the item label.
625 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 625 def get_item_text_colour(item) end |
#get_last_child(item) ⇒ Wx::TreeItemId Also known as: last_child
Returns the last child of the item (or an invalid tree item if this item has no children).
636 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 636 def get_last_child(item) end |
#get_next_child(parent_id, cookie) ⇒ Array(Wx::TreeItemId, Object)
Returns the next child; call #get_first_child() for the first child. For this enumeration function you must pass in a ‘cookie’ parameter which is opaque for the application but is necessary for the library to make these functions reentrant (i.e. allow more than one enumeration on one and the same object simultaneously). The cookie returned from (and passed to) #get_first_child() and #get_next_child() should be the same variable.
Returns an invalid tree item if there are no further children.
42 |
# File 'lib/wx/doc/tree_ctrl.rb', line 42 def get_next_child(parent_id, ) end |
#get_next_sibling(item) ⇒ Wx::TreeItemId Also known as: next_sibling
Returns the next sibling of the specified item; call #get_prev_sibling for the previous sibling.
Returns an invalid tree item if there are no further siblings.
645 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 645 def get_next_sibling(item) end |
#get_next_visible(item) ⇒ Wx::TreeItemId Also known as: next_visible
Returns the next visible item or an invalid item if this item is the last visible one.
The item itself must be visible.
657 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 657 def get_next_visible(item) end |
#get_prev_sibling(item) ⇒ Wx::TreeItemId Also known as: prev_sibling
Returns the previous sibling of the specified item; call #get_next_sibling for the next sibling.
Returns an invalid tree item if there are no further children.
666 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 666 def get_prev_sibling(item) end |
#get_prev_visible(item) ⇒ Wx::TreeItemId Also known as: prev_visible
Returns the previous visible item or an invalid item if this item is the first visible one.
The item itself must be visible.
678 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 678 def get_prev_visible(item) end |
#get_quick_best_size ⇒ Boolean Also known as: quick_best_size
Returns true if the control will use a quick calculation for the best size, looking only at the first and last items.
The default is false.
686 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 686 def get_quick_best_size; end |
#get_root_item ⇒ Wx::TreeItemId Also known as: root_item
Returns the root item for the tree control.
691 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 691 def get_root_item; end |
#get_root_items ⇒ Array<Wx::TreeItemId>
Returns an array of tree item ids of the current child items of the root. Mainly useful for tree control using TR_HIDE_ROOT style where there are multiple root-like items.
61 |
# File 'lib/wx/doc/tree_ctrl.rb', line 61 def get_root_items; end |
#get_selection ⇒ Wx::TreeItemId Also known as: selection
Returns the selection, or an invalid item if there is no selection.
This function only works with the controls without Wx::TR_MULTIPLE style, use #get_selections for the controls which do have this style or, if a single item is wanted, use #get_focused_item.
698 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 698 def get_selection; end |
#get_selections ⇒ Array<Wx::TreeItemId>
Returns an array of tree item ids of the currently selected items. This function can be called only if the control has the wxTR_MULTIPLE style.
66 |
# File 'lib/wx/doc/tree_ctrl.rb', line 66 def get_selections; end |
#get_spacing ⇒ Integer Also known as: spacing
Returns the current tree control spacing.
This is the number of horizontal pixels between the buttons and the state images.
564 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 564 def get_spacing; end |
#get_state_image_list ⇒ Wx::ImageList Also known as: state_image_list
Returns the state image list (from which application-defined state images are taken).
703 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 703 def get_state_image_list; end |
#hit_test(point) ⇒ Array(Wx::TreeItemId,Integer)
Calculates which (if any) item is under the given point, returning the tree item id at this point plus extra information flags.
flags is a bitlist of the following:
-
Wx::TREE_HITTEST_ABOVE: Above the client area.
-
Wx::TREE_HITTEST_BELOW: Below the client area.
-
Wx::TREE_HITTEST_NOWHERE: In the client area but below the last item.
-
Wx::TREE_HITTEST_ONITEMBUTTON: On the button associated with an item.
-
Wx::TREE_HITTEST_ONITEMICON: On the bitmap associated with an item.
-
Wx::TREE_HITTEST_ONITEMINDENT: In the indentation associated with an item.
-
Wx::TREE_HITTEST_ONITEMLABEL: On the label (string) associated with an item.
-
Wx::TREE_HITTEST_ONITEMRIGHT: In the area to the right of an item.
-
Wx::TREE_HITTEST_ONITEMSTATEICON: On the state icon for a tree view item that is in a user-defined state.
-
Wx::TREE_HITTEST_TOLEFT: To the right of the client area.
-
Wx::TREE_HITTEST_TORIGHT: To the left of the client area.
723 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 723 def hit_test(point) end |
#insert_item(parent, previous, text, image = -1,, selImage = -1,, data = nil) ⇒ Wx::TreeItemId
Inserts an item after a given one (previous).
The image and selImage parameters are an index within the normal image list specifying the image to use for unselected and selected items, respectively. If image > -1 and selImage is -1, the same image is used for both selected and unselected items.
735 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 735 def insert_item(parent, previous, text, image=-1, selImage=-1, data=nil) end |
#insert_item_before(parent, pos, text, image = -1,, selImage = -1,, data = nil) ⇒ Wx::TreeItemId
Inserts an item before one identified by its position (pos). pos must be less than or equal to the number of children. The image and selImage parameters are an index within the normal image list specifying the image to use for unselected and selected items, respectively. If image > -1 and selImage is -1, the same image is used for both selected and unselected items.
79 |
# File 'lib/wx/doc/tree_ctrl.rb', line 79 def insert_item_before(parent, pos, text, image=-1, selImage=-1, data=nil) end |
#is_bold(item) ⇒ Boolean Also known as: bold?
Returns true if the given item is in bold state.
743 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 743 def is_bold(item) end |
#is_empty ⇒ Boolean Also known as: empty?
Returns true if the control is empty (i.e. has no items, even no root one).
748 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 748 def is_empty; end |
#is_expanded(item) ⇒ Boolean Also known as: expanded?
Returns true if the item is expanded (only makes sense if it has children).
754 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 754 def (item) end |
#is_selected(item) ⇒ Boolean Also known as: selected?
Returns true if the item is selected.
760 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 760 def is_selected(item) end |
#is_visible(item) ⇒ Boolean Also known as: visible?
Returns true if the item is visible on the screen.
766 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 766 def is_visible(item) end |
#item_has_children(item) ⇒ Boolean
Returns true if the item has children.
772 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 772 def item_has_children(item) end |
#on_compare_items(item1, item2) ⇒ Integer
Override this function in the derived class to change the sort order of the items in the tree control.
The function should return a negative, zero or positive value if the first item is less than, equal to or greater than the second one. Please note that you must use RTTI macros declare_dynamic_class and implement_dynamic_class if you override this function because otherwise the base class considers that it is not overridden and uses the default comparison, i.e. sorts the items alphabetically, which allows it optimize away the calls to the virtual function completely.
782 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 782 def on_compare_items(item1, item2) end |
#prepend_item(parent, text, image = -1,, selImage = -1,, data = nil) ⇒ Wx::TreeItemId
Appends an item as the first child of parent, return a new item id.
The image and selImage parameters are an index within the normal image list specifying the image to use for unselected and selected items, respectively. If image > -1 and selImage is -1, the same image is used for both selected and unselected items.
793 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 793 def prepend_item(parent, text, image=-1, selImage=-1, data=nil) end |
#scroll_to(item) ⇒ void
This method returns an undefined value.
Scrolls the specified item into view.
Note that this method doesn’t work while the window is frozen (See Window#freeze), at least under MSW.
801 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 801 def scroll_to(item) end |
#select_children(parent) ⇒ void
This method returns an undefined value.
Select all the immediate children of the given parent.
This function can be used with multiselection controls only.
997 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 997 def select_children(parent) end |
#select_item(item, select = true) ⇒ void
This method returns an undefined value.
Selects the given item.
In multiple selection controls, can be also used to deselect a currently selected item if the value of select is false. Notice that calling this method will generate EVT_TREE_SEL_CHANGING and EVT_TREE_SEL_CHANGED events and that the change could be vetoed by the former event handler.
810 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 810 def select_item(item, select=true) end |
#set_buttons_image_list(imageList) ⇒ void Also known as:
This method returns an undefined value.
Sets the buttons image list (from which application-defined button images are taken).
The button images assigned with this method will not be deleted by Wx::TreeCtrl‘s destructor, you must delete it yourself. Setting or assigning the button image list enables the display of image buttons. Once enabled, the only way to disable the display of button images is to set the button image list to NULL.
This function is only available in the generic version.
825 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 825 def (imageList) end |
#set_focused_item(item) ⇒ void Also known as: focused_item=
This method returns an undefined value.
Sets the currently focused item.
552 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 552 def set_focused_item(item) end |
#set_indent(indent) ⇒ void Also known as: indent=
This method returns an undefined value.
Sets the indentation for the tree control.
831 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 831 def set_indent(indent) end |
#set_item_background_colour(item, col) ⇒ void
This method returns an undefined value.
Sets the colour of the item’s background.
846 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 846 def set_item_background_colour(item, col) end |
#set_item_bold(item, bold = true) ⇒ void Also known as: item_bold=
This method returns an undefined value.
Makes item appear in bold font if bold parameter is true or resets it to the normal state.
855 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 855 def set_item_bold(item, bold=true) end |
#set_item_data(item, data) ⇒ void
This method returns an undefined value.
Sets the item client data.
Notice that the client data previously associated with the item (if any) is not freed by this function and so calling this function multiple times for the same item will result in memory leaks unless you delete the old item data pointer yourself.
864 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 864 def set_item_data(item, data) end |
#set_item_drop_highlight(item, highlight = true) ⇒ void Also known as: item_drop_highlight=
This method returns an undefined value.
Gives the item the visual feedback for Drag’n’Drop actions, which is useful if something is dragged from the outside onto the tree control (as opposed to a DnD operation within the tree control, which already is implemented internally).
870 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 870 def set_item_drop_highlight(item, highlight=true) end |
#set_item_font(item, font) ⇒ void
This method returns an undefined value.
Sets the item’s font.
All items in the tree should have the same height to avoid text clipping, so the fonts height should be the same for all of them, although font attributes may vary.
880 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 880 def set_item_font(item, font) end |
#set_item_has_children(item, hasChildren = true) ⇒ void Also known as: item_has_children=
This method returns an undefined value.
Force appearance of the button next to the item.
This is useful to allow the user to expand the items which don’t have any children now, but instead adding them only when needed, thus minimizing memory usage and loading time.
888 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 888 def set_item_has_children(item, hasChildren=true) end |
#set_item_image(item, image, which = Wx::TreeItemIcon::TreeItemIcon_Normal) ⇒ void
This method returns an undefined value.
Sets the specified item’s image.
See #get_item_image for the description of the which parameter.
898 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 898 def set_item_image(item, image, which=Wx::TreeItemIcon::TreeItemIcon_Normal) end |
#set_item_state(item, state) ⇒ void
This method returns an undefined value.
Sets the specified item state.
The value of state may be an index into the state image list, or one of the special values:
-
Wx::TREE_ITEMSTATE_NONE: to disable the item state (the state image will be not displayed).
-
Wx::TREE_ITEMSTATE_NEXT: to set the next item state.
-
Wx::TREE_ITEMSTATE_PREV: to set the previous item state.
910 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 910 def set_item_state(item, state) end |
#set_item_text(item, text) ⇒ void
This method returns an undefined value.
Sets the item label.
916 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 916 def set_item_text(item, text) end |
#set_item_text_colour(item, col) ⇒ void
This method returns an undefined value.
Sets the colour of the item’s text.
922 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 922 def set_item_text_colour(item, col) end |
#set_quick_best_size(quickBestSize) ⇒ void Also known as: quick_best_size=
This method returns an undefined value.
If true is passed, specifies that the control will use a quick calculation for the best size, looking only at the first and last items.
Otherwise, it will look at all items. The default is false.
930 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 930 def set_quick_best_size(quickBestSize) end |
#set_spacing(spacing) ⇒ void Also known as: spacing=
This method returns an undefined value.
Sets the spacing for the tree control.
Spacing is the number of horizontal pixels between the buttons and the state images. This has no effect under WXMSW.
839 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 839 def set_spacing(spacing) end |
#set_state_image_list(imageList) ⇒ void Also known as: state_image_list=
This method returns an undefined value.
Sets the state image list (from which application-defined state images are taken).
Image list assigned with this method will not be deleted by Wx::TreeCtrl‘s destructor, you must delete it yourself.
939 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 939 def set_state_image_list(imageList) end |
#set_window_style(styles) ⇒ void Also known as: window_style=
This method returns an undefined value.
Sets the mode flags associated with the display of the tree control.
The new mode takes effect immediately.
Generic only; MSW ignores changes.
953 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 953 def set_window_style(styles) end |
#sort_children(item) ⇒ void
This method returns an undefined value.
Sorts the children of the given item using #on_compare_items.
You should override that method to change the sort order (the default is ascending case-sensitive alphabetical order).
963 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 963 def sort_children(item) end |
#toggle(item) ⇒ void
This method returns an undefined value.
Toggles the given item between collapsed and expanded states.
968 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 968 def toggle(item) end |
#toggle_item_selection(item) ⇒ void
This method returns an undefined value.
Toggles the given item between selected and unselected states.
For multiselection controls only.
975 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 975 def toggle_item_selection(item) end |
#traverse(start_id = nil) {|child_id| ... } ⇒ Object, Enumerator Also known as: each
Yield each tree item id (recursively) to the given block. Starts at tree item specified or at root if none specified. Returns an Enumerator if no block given.
18 |
# File 'lib/wx/doc/tree_ctrl.rb', line 18 def traverse(start_id=nil) end |
#unselect ⇒ void
This method returns an undefined value.
Removes the selection from the currently selected item (if any).
979 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 979 def unselect; end |
#unselect_all ⇒ void
This method returns an undefined value.
This function either behaves the same as #unselect if the control doesn’t have Wx::TR_MULTIPLE style, or removes the selection from all items if it does have this style.
983 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 983 def unselect_all; end |
#unselect_item(item) ⇒ void
This method returns an undefined value.
Unselects the given item.
This works in multiselection controls only.
990 |
# File 'lib/wx/doc/gen/tree_ctrl.rb', line 990 def unselect_item(item) end |