FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SelectionNodeBase

    struct · ferroui-controls · v0.5.0

    struct SelectionNodeBase<T: PropertyValue>
    

    Base class for selection models.

    T is the type of the element being selected.

    View source

    Members

    new

    fn new(derived: Weak<dyn SelectionNodeBaseImpl<T>>) -> Self
    

    Creates the base state of the object deriving from it; derived receives the virtual calls.

    Source

    source

    fn source(self: &Self) -> Option<ItemsSource>
    

    Gets the source collection.

    Source

    set_source

    fn set_source(self: &Self, value: Option<ItemsSource>)
    

    Sets the source collection.

    Source

    items_view

    fn items_view(self: &Self) -> Option<ItemsSourceViewOf<T>>
    

    Gets a view of the source.

    Source

    set_items_view

    fn set_items_view(self: &Self, value: Option<ItemsSourceViewOf<T>>)
    

    Sets the view of the source.

    Source

    ranges_enabled

    fn ranges_enabled(self: &Self) -> bool
    

    Gets a value indicating whether range selection is currently enabled for the selection node.

    Source

    set_ranges_enabled

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

    Sets a value indicating whether range selection is currently enabled for the selection node.

    Source

    on_source_collection_change_started

    fn on_source_collection_change_started(self: &Self)
    

    Called when the source collection starts changing.

    Source

    on_source_collection_changed

    fn on_source_collection_changed(self: &Self, e: &ItemsChangedEventArgs<'_>)
    

    Called when the source collection changes.

    The implementation here calls on_items_added and on_items_removed in order to calculate how the collection change affects the currently selected items. It then calls on_indexes_changed and on_selection_removed if necessary, according to the CollectionChangeState returned by those methods.

    Source

    on_source_collection_change_finished

    fn on_source_collection_change_finished(self: &Self)
    

    Called when the source collection has finished changing, and all collection changed handlers have run.

    Source

    on_indexes_changed

    fn on_indexes_changed(self: &Self, _shift_index: i32, _shift_delta: i32)
    

    Called by the handling of a collection change, detailing the indexes changed by the collection changing.

    Source

    on_selection_removed

    fn on_selection_removed(self: &Self, _index: i32, _count: i32, _deselected_items: Vec<Option<T>>)
    

    Called by the handling of a collection change, detailing the items removed by a collection change.

    Source

    commit_select

    fn commit_select(self: &Self, begin: i32, end: i32) -> i32
    

    If ranges are enabled, adds the specified inclusive range to the selection. Returns the number of items selected.

    Source

    commit_deselect

    fn commit_deselect(self: &Self, begin: i32, end: i32) -> i32
    

    If ranges are enabled, removes the specified inclusive range from the selection. Returns the number of items deselected.

    Source

    on_items_added

    fn on_items_added(self: &Self, index: i32, items: ItemsView<'_>) -> CollectionChangeState<T>
    

    Called by the handling of a collection change when items are added to the source collection.

    The implementation here adjusts the selected ranges, assigning new indexes.

    Source

    on_items_removed

    fn on_items_removed(self: &Self, index: i32, items: ItemsView<'_>) -> CollectionChangeState<T>
    

    Called by the handling of a collection change when items are removed from the source collection.

    The implementation here adjusts the selected ranges, assigning new indexes.

    Source

    is_valid_collection_change

    fn is_valid_collection_change(self: &Self, e: &ItemsChangedEventArgs<'_>) -> bool
    

    Whether a collection change can be applied to the selection.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ClassDefaults
    • ErasedDestructor
    • IntoEither

    Availability

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