pub struct CellSelection {
pub lead_cell: Option<(usize, usize)>,
}Expand description
Select a single cell in the table.
This one supports cell + column + row selection.
Fields§
§lead_cell: Option<(usize, usize)>Selected cell.
Implementations§
Source§impl CellSelection
impl CellSelection
Sourcepub fn new() -> CellSelection
pub fn new() -> CellSelection
New
pub fn has_selection(&mut self) -> bool
Sourcepub fn select_row(&mut self, select: Option<usize>) -> bool
pub fn select_row(&mut self, select: Option<usize>) -> bool
Select a row. Column stays the same.
Sourcepub fn select_column(&mut self, select: Option<usize>) -> bool
pub fn select_column(&mut self, select: Option<usize>) -> bool
Select a column, row stays the same.
Sourcepub fn move_to(
&mut self,
select: (usize, usize),
maximum: (usize, usize),
) -> bool
pub fn move_to( &mut self, select: (usize, usize), maximum: (usize, usize), ) -> bool
Select a cell, clamp between 0 and maximum.
Sourcepub fn move_to_col(&mut self, col: usize, maximum: usize) -> bool
pub fn move_to_col(&mut self, col: usize, maximum: usize) -> bool
Select a column. Row stays the same.
Sourcepub fn move_to_row(&mut self, row: usize, maximum: usize) -> bool
pub fn move_to_row(&mut self, row: usize, maximum: usize) -> bool
Select a row. Column stays the same.
Sourcepub fn move_down(&mut self, n: usize, maximum: usize) -> bool
pub fn move_down(&mut self, n: usize, maximum: usize) -> bool
Select the next row, clamp between 0 and maximum.
Sourcepub fn move_up(&mut self, n: usize, maximum: usize) -> bool
pub fn move_up(&mut self, n: usize, maximum: usize) -> bool
Select the previous row, clamp between 0 and maximum.
Sourcepub fn move_right(&mut self, n: usize, maximum: usize) -> bool
pub fn move_right(&mut self, n: usize, maximum: usize) -> bool
Select the next column, clamp between 0 and maximum.
Trait Implementations§
Source§impl Clone for CellSelection
impl Clone for CellSelection
Source§fn clone(&self) -> CellSelection
fn clone(&self) -> CellSelection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CellSelection
impl Debug for CellSelection
Source§impl Default for CellSelection
impl Default for CellSelection
Source§fn default() -> CellSelection
fn default() -> CellSelection
Returns the “default value” for a type. Read more
Source§impl TableSelection for CellSelection
impl TableSelection for CellSelection
Source§fn is_selected_row(&self, row: usize) -> bool
fn is_selected_row(&self, row: usize) -> bool
Row is selected. This can be separate from
is_selected_cell.Source§fn is_selected_column(&self, column: usize) -> bool
fn is_selected_column(&self, column: usize) -> bool
Column is selected. This can be separate from
is_selected_cell.Auto Trait Implementations§
impl Freeze for CellSelection
impl RefUnwindSafe for CellSelection
impl Send for CellSelection
impl Sync for CellSelection
impl Unpin for CellSelection
impl UnwindSafe for CellSelection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more