Skip to main content

TableViewSelection

Struct TableViewSelection 

Source
pub struct TableViewSelection { /* private fields */ }
Expand description

The selected row of a TableView: at most one, as WinUI’s v1 has it.

The application makes one with TableViewSelection::new, gives it to the table with TableView::selection, and disposes it after the table. A table given none selects nothing.

Implementations§

Source§

impl TableViewSelection

Source

pub fn new(app: &mut App) -> Ref<Self>

Creates a selection with nothing selected.

Source

pub fn dispose(self: Handle<Self>, app: &mut App)

Releases the listeners, including the one on the source it follows; the selection is not used after.

Source

pub fn select(self: Handle<Self>, app: &mut App, index: usize)

Select: the row index of the view becomes the selection. Nothing while no table holds the selection, while its mode is None, or for an index past the rows: an existing selection is never cleared to signal a refusal.

Source

pub fn deselect(self: Handle<Self>, app: &mut App, index: usize)

Deselect: clears the selection only when index is the selected row, so a stale call cannot clear a newer one.

Source

pub fn is_selected(self: Handle<Self>, app: &App, index: usize) -> bool

IsSelected.

Source

pub fn deselect_all(self: Handle<Self>, app: &mut App)

DeselectAll, whatever the selection mode.

Source

pub fn selected_index(self: Handle<Self>, app: &App) -> Option<usize>

SelectedIndex: the selected row of the view.

Source

pub fn selected_item(self: Handle<Self>, app: &App) -> Option<usize>

SelectedItem: the selected row’s index in the source’s items.

Trait Implementations§

Source§

impl ChangeNotifier for TableViewSelection

Source§

fn change_notifier_data(&self) -> &ChangeNotifierData

Source§

fn change_notifier_data_mut(&mut self) -> &mut ChangeNotifierData

Source§

fn will_add_listener(self: Handle<Self>, app: &mut App)

Runs before the listener is stored. Dart overrides of addListener that work before super.addListener go here.
Source§

fn did_remove_listener(self: Handle<Self>, app: &mut App)

Runs after the listener is removed. Dart overrides of removeListener that work after super.removeListener go here.
Source§

impl Debug for TableViewSelection

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for TableViewSelection

§

impl !Send for TableViewSelection

§

impl !Sync for TableViewSelection

§

impl !UnwindSafe for TableViewSelection

§

impl Forget for TableViewSelection

§

impl Freeze for TableViewSelection
where *const u8 is !null: Freeze, PhantomData<Option<Listener>>: Freeze, *const RcInner<Cell<usize>> is !null: Freeze, PhantomData<RcInner<Cell<usize>>>: Freeze, PhantomData<RangeInclusive<usize>>: Freeze, NonZero<u32>: Freeze, *const RcInner<dyn Fn(&App, usize) -> Option<usize>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&App, usize) -> Option<usize>>>: Freeze, *const RcInner<dyn Fn(&mut App, Listener)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, Listener)>>: Freeze, *const RcInner<dyn Fn(&mut App, &Listener)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, &Listener)>>: Freeze, *const RcInner<dyn Fn(&App) -> Vec<ViewChange>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&App) -> Vec<ViewChange>>>: Freeze, *const RcInner<dyn Fn(&App) -> usize> is !null: Freeze, PhantomData<RcInner<dyn Fn(&App) -> usize>>: Freeze, *const RcInner<dyn Fn(&mut App)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze, *const (): Freeze,

§

impl Move for TableViewSelection

§

impl Unpin for TableViewSelection
where *const u8 is !null: Unpin, Rc<dyn Fn(&mut App)>: Unpin, NonZero<u32>: Unpin, *const (): Unpin, Rc<Cell<usize>>: Unpin, Rc<dyn Fn(&App, usize) -> Option<usize>>: Unpin, Rc<dyn Fn(&mut App, Listener)>: Unpin, Rc<dyn Fn(&mut App, &Listener)>: Unpin, Rc<dyn Fn(&App) -> Vec<ViewChange>>: Unpin, Rc<dyn Fn(&App) -> usize>: Unpin,

§

impl UnsafeUnpin for TableViewSelection
where *const u8 is !null: UnsafeUnpin, PhantomData<Option<Listener>>: UnsafeUnpin, *const RcInner<Cell<usize>> is !null: UnsafeUnpin, PhantomData<RcInner<Cell<usize>>>: UnsafeUnpin, PhantomData<RangeInclusive<usize>>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, *const RcInner<dyn Fn(&App, usize) -> Option<usize>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&App, usize) -> Option<usize>>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, Listener)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, Listener)>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, &Listener)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, &Listener)>>: UnsafeUnpin, *const RcInner<dyn Fn(&App) -> Vec<ViewChange>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&App) -> Vec<ViewChange>>>: UnsafeUnpin, *const RcInner<dyn Fn(&App) -> usize> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&App) -> usize>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin, *const (): UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ListenableObject for T
where T: ChangeNotifier,

Source§

fn add_listener(self: Handle<T>, app: &mut App, listener: Listener)

Register a closure to be called when the object notifies its listeners.
Source§

fn remove_listener(self: Handle<T>, app: &mut App, listener: &Listener)

Remove a previously registered closure from the list of closures that the object notifies.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>