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.
Members
newsourceset_sourceitems_viewset_items_viewranges_enabledset_ranges_enabledon_source_collection_change_startedon_source_collection_changedon_source_collection_change_finishedon_indexes_changedon_selection_removedcommit_selectcommit_deselecton_items_addedon_items_removedis_valid_collection_change
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
fn source(self: &Self) -> Option<ItemsSource>
Gets the source collection.
set_source
fn set_source(self: &Self, value: Option<ItemsSource>)
Sets the source collection.
items_view
fn items_view(self: &Self) -> Option<ItemsSourceViewOf<T>>
Gets a view of the source.
set_items_view
fn set_items_view(self: &Self, value: Option<ItemsSourceViewOf<T>>)
Sets the view of the source.
ranges_enabled
fn ranges_enabled(self: &Self) -> bool
Gets a value indicating whether range selection is currently enabled for the selection node.
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.
on_source_collection_change_started
fn on_source_collection_change_started(self: &Self)
Called when the source collection starts changing.
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.
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.
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.
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.
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.
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.
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.
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.
is_valid_collection_change
fn is_valid_collection_change(self: &Self, e: &ItemsChangedEventArgs<'_>) -> bool
Whether a collection change can be applied to the selection.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEither
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.