FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    TreeView

    struct · ferroui-controls · v0.5.0

    struct TreeView
    

    Displays a hierarchical tree of data.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<TreeView>
    

    Returns a strong reference to this object.

    Source

    should_trigger_selection

    fn should_trigger_selection(self: &Self, selectable: &Visual, event_args: &PointerEventArgs) -> bool
    

    Analyses a pointer event received by a selectable element, and determines whether the action should trigger selection on press, on release, or not at all.

    Source

    should_trigger_selection_key

    fn should_trigger_selection_key(self: &Self, selectable: &Visual, event_args: &KeyEventArgs) -> bool
    

    Analyses a key event received by a selectable element, and determines whether the action should trigger selection.

    Source

    update_selection_from_event

    fn update_selection_from_event(self: &Self, container: &Ref<Control>, event_args: &dyn IRoutedEventArgs) -> bool
    

    Updates the selection based on an event that may have originated in a container that belongs to the control.

    Returns true if the event originated from a container that belongs to the control and triggered selection; otherwise false.

    Source

    auto_scroll_to_selected_item_property

    fn auto_scroll_to_selected_item_property() -> &'static StyledProperty<bool>
    

    Defines the AutoScrollToSelectedItem property.

    Source

    selected_item_property

    fn selected_item_property() -> &'static DirectProperty<TreeView, Option<BoxedValue>>
    

    Defines the SelectedItem property.

    Source

    selected_items_property

    fn selected_items_property() -> &'static DirectProperty<TreeView, Option<SelectedItemsList>>
    

    Defines the SelectedItems property.

    Source

    selection_mode_property

    fn selection_mode_property() -> &'static StyledProperty<SelectionMode>
    

    Defines the SelectionMode property.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see ferroui_base::FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Source

    selection_changed

    fn selection_changed(self: &Self, handler: impl Fn(&Interactive, &SelectionChangedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
    

    Occurs when the control's selection changes.

    Source

    auto_scroll_to_selected_item

    fn auto_scroll_to_selected_item(self: &Self) -> bool
    

    Gets or sets a value indicating whether to automatically scroll to newly selected items.

    This property is of limited use with TreeView as it will only scroll to realized items. To scroll to a non-expanded item, you need to ensure that its ancestors are expanded.

    Source

    set_auto_scroll_to_selected_item

    fn set_auto_scroll_to_selected_item(self: &Self, value: bool)
    

    Source

    selection_mode

    fn selection_mode(self: &Self) -> SelectionMode
    

    Gets or sets the selection mode.

    Source

    set_selection_mode

    fn set_selection_mode(self: &Self, value: SelectionMode)
    

    Source

    selected_item

    fn selected_item(self: &Self) -> Option<BoxedValue>
    

    Gets or sets the selected item.

    Note that setting this property only currently works if the item is expanded to be visible.

    Source

    set_selected_item

    fn set_selected_item(self: &Self, value: Option<BoxedValue>)
    

    Source

    selected_items

    fn selected_items(self: &Self) -> SelectedItemsList
    

    Gets or sets the selected items.

    Source

    set_selected_items

    fn set_selected_items(self: &Self, value: Option<SelectedItemsList>)
    

    Source

    expand_sub_tree

    fn expand_sub_tree(self: &Self, item: &TreeViewItem)
    

    Expands the specified TreeViewItem and all its descendent TreeViewItems.

    Source

    collapse_sub_tree

    fn collapse_sub_tree(self: &Self, item: &TreeViewItem)
    

    Collapses the specified TreeViewItem and all its descendent TreeViewItems.

    Source

    select_all

    fn select_all(self: &Self)
    

    Selects all items in the TreeView.

    Note that this method only selects nodes currently visible due to their parent nodes being expanded: it does not expand nodes.

    Source

    unselect_all

    fn unselect_all(self: &Self)
    

    Deselects all items in the TreeView.

    Source

    get_realized_tree_containers

    fn get_realized_tree_containers(self: &Self) -> Vec<Ref<Control>>
    

    Gets the currently realized containers of the whole tree.

    Source

    tree_container_from_item

    fn tree_container_from_item(self: &Self, item: &Option<BoxedValue>) -> Option<Ref<Control>>
    

    Returns the container of the specified item, searching the whole tree.

    Source

    tree_item_from_container

    fn tree_item_from_container(self: &Self, container: &Ref<Control>) -> Option<BoxedValue>
    

    Returns the item of the specified container, searching the whole tree.

    Source

    update_selection_from_container

    fn update_selection_from_container(self: &Self, container: &Ref<Control>, select: bool, range_modifier: bool, toggle_modifier: bool, right_button: bool)
    

    Updates the selection for an item based on user interaction.

    select is whether the item should be selected or unselected, range_modifier whether the range modifier is enabled (i.e. the shift key), toggle_modifier whether the toggle modifier is enabled (i.e. the control key) and right_button whether the event is a right-click.

    Source

    update_selection_from_event_source

    fn update_selection_from_event_source(self: &Self, event_source: Option<Ref<FerroObject>>, select: bool, range_modifier: bool, toggle_modifier: bool, right_button: bool) -> bool
    

    Updates the selection based on an event that may have originated in a container that belongs to the control.

    event_source is the control that raised the event; the other arguments are those of update_selection_from_container.

    Returns true if the event originated from a container that belongs to the control; otherwise false.

    Source

    get_container_from_event_source

    fn get_container_from_event_source(self: &Self, event_source: Option<Ref<FerroObject>>) -> Option<Ref<TreeViewItem>>
    

    Tries to get the container that was the source of an event.

    Returns the container or None if the event did not originate in a container.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.