Struct rat_widget::table::selection::CellSelection
source · 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 copy 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.source§fn scroll_selected(&self) -> bool
fn scroll_selected(&self) -> bool
Should scroll be in terms of the selection or in terms of the offset.
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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