FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SelectionModel

    struct · ferroui-controls · v0.5.0

    struct SelectionModel<T: PropertyValue>
    

    A selection model: the selection of the items of a source collection of items of type T. The untyped model is SelectionModel<BoxedValue>.

    View source

    Members

    new

    fn new() -> Rc<Self>
    

    Creates a selection model without a source.

    Source

    with_source

    fn with_source(source: Option<ItemsSource>) -> Rc<Self>
    

    Creates a selection model for a source.

    Source

    set_derived

    fn set_derived(self: &Self, derived: Weak<dyn SelectionModelImpl<T>>)
    

    Registers the object deriving from this model, which receives the virtual calls (see SelectionModelImpl).

    Source

    node

    fn node(self: &Self) -> &SelectionNodeBase<T>
    

    The base state of the model.

    Source

    source

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

    Source

    set_source

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

    Source

    single_select

    fn single_select(self: &Self) -> bool
    

    Source

    set_single_select

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

    Source

    selected_index

    fn selected_index(self: &Self) -> i32
    

    Source

    set_selected_index

    fn set_selected_index(self: &Self, value: i32)
    

    Source

    selected_indexes

    fn selected_indexes(self: &Self) -> Rc<dyn IReadOnlySelectionList<i32>>
    

    The selected indexes: a view of the selection, always the same list.

    Source

    selected_item

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

    Source

    set_selected_item

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

    Source

    selected_items

    fn selected_items(self: &Self) -> Rc<dyn IReadOnlySelectionList<Option<T>>>
    

    The selected items: a view of the selection. Before a source is assigned, the items selected by item.

    Source

    anchor_index

    fn anchor_index(self: &Self) -> i32
    

    Source

    set_anchor_index

    fn set_anchor_index(self: &Self, value: i32)
    

    Source

    count

    fn count(self: &Self) -> usize
    

    The number of selected items.

    Source

    indexes_changed

    fn indexes_changed(self: &Self, handler: impl Fn(&SelectionModelIndexesChangedEventArgs) -> () + 'static) -> Subscription
    

    Subscribes to the event raised when a change to the source shifts the indexes of selected items.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the model.

    Source

    selection_changed

    fn selection_changed(self: &Self, handler: impl Fn(&SelectionModelSelectionChangedEventArgsOf<T>) -> () + 'static) -> Subscription
    

    Subscribes to the event raised when the selection changes.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the model.

    Source

    lost_selection

    fn lost_selection(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Subscribes to the event raised when the selection becomes empty.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the model.

    Source

    source_reset

    fn source_reset(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Subscribes to the event raised when the source is reset.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the model.

    Source

    batch_update

    fn batch_update(self: &Self) -> BatchUpdateOperation
    

    Begins a batch update that ends when the returned operation is disposed or dropped.

    Source

    begin_batch_update

    fn begin_batch_update(self: &Self)
    

    Source

    end_batch_update

    fn end_batch_update(self: &Self)
    

    Source

    is_selected

    fn is_selected(self: &Self, index: i32) -> bool
    

    Source

    select

    fn select(self: &Self, index: i32)
    

    Source

    deselect

    fn deselect(self: &Self, index: i32)
    

    Source

    select_range

    fn select_range(self: &Self, start: i32, end: i32)
    

    Source

    deselect_range

    fn deselect_range(self: &Self, start: i32, end: i32)
    

    Source

    select_all

    fn select_all(self: &Self)
    

    Source

    clear

    fn clear(self: &Self)
    

    Source

    raise_property_changed

    fn raise_property_changed(self: &Self, property_name: &str)
    

    Raises the property changed event.

    Source

    base_set_source

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

    The implementation of set_source of this type.

    Source

    base_on_indexes_changed

    fn base_on_indexes_changed(self: &Self, shift_index: i32, shift_delta: i32)
    

    The implementation of on_indexes_changed of this type.

    Source

    base_on_source_collection_change_started

    fn base_on_source_collection_change_started(self: &Self)
    

    The implementation of on_source_collection_change_started of this type.

    Source

    base_on_source_reset

    fn base_on_source_reset(self: &Self)
    

    The implementation of on_source_reset of this type.

    Source

    base_on_selection_removed

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

    The implementation of on_selection_removed of this type.

    Source

    base_on_items_added

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

    The implementation of on_items_added of this type.

    Source

    base_on_items_removed

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

    The implementation of on_items_removed of this type.

    Source

    base_on_source_collection_changed

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

    The implementation of on_source_collection_changed of this type.

    Source

    base_is_valid_collection_change

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

    The implementation of is_valid_collection_change of this type.

    Source

    base_on_source_collection_change_finished

    fn base_on_source_collection_change_finished(self: &Self)
    

    The implementation of on_source_collection_change_finished of this type.

    Source

    Trait implementations

    Availability

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