Struct rat_widget::table::RTableState
source · pub struct RTableState<Selection> {
pub widget: FTableState<Selection>,
pub non_exhaustive: NonExhaustive,
}Fields§
§widget: FTableState<Selection>§non_exhaustive: NonExhaustiveImplementations§
source§impl<Selection> RTableState<Selection>
impl<Selection> RTableState<Selection>
sourcepub fn row_cells(&self, row: usize) -> Option<(Rect, Vec<Rect>)>
pub fn row_cells(&self, row: usize) -> Option<(Rect, Vec<Rect>)>
Returns the column-areas for the given row, if it is visible.
Attention: These areas might be 0-length if the column is scrolled beyond the table-area.
sourcepub fn cell_at_clicked(&self, pos: (u16, u16)) -> Option<(usize, usize)>
pub fn cell_at_clicked(&self, pos: (u16, u16)) -> Option<(usize, usize)>
Cell at given position.
sourcepub fn cell_at_drag(&self, pos: (u16, u16)) -> (usize, usize)
pub fn cell_at_drag(&self, pos: (u16, u16)) -> (usize, usize)
Cell when dragging. Can go outside the area.
sourcepub fn row_at_drag(&self, pos: (u16, u16)) -> usize
pub fn row_at_drag(&self, pos: (u16, u16)) -> usize
Row when dragging. Can go outside the area.
sourcepub fn column_at_drag(&self, pos: (u16, u16)) -> usize
pub fn column_at_drag(&self, pos: (u16, u16)) -> usize
Column when dragging. Can go outside the area.
sourcepub fn clear_offset(&mut self)
pub fn clear_offset(&mut self)
Sets both offsets to 0.
source§impl<Selection: TableSelection> RTableState<Selection>
impl<Selection: TableSelection> RTableState<Selection>
source§impl RTableState<RowSelection>
impl RTableState<RowSelection>
sourcepub fn set_scroll_selection(&mut self, scroll: bool)
pub fn set_scroll_selection(&mut self, scroll: bool)
Scroll selection instead of offset.
sourcepub fn scroll_selection(&self) -> bool
pub fn scroll_selection(&self) -> bool
Scroll selection instead of offset.
pub fn clear_selection(&mut self)
pub fn has_selection(&mut self) -> bool
pub fn selected(&self) -> Option<usize>
pub fn select(&mut self, row: Option<usize>)
sourcepub fn select_clamped(&mut self, select: usize, maximum: usize)
pub fn select_clamped(&mut self, select: usize, maximum: usize)
Select a row, clamp between 0 and maximum.
source§impl RTableState<RowSetSelection>
impl RTableState<RowSetSelection>
sourcepub fn clear_selection(&mut self)
pub fn clear_selection(&mut self)
Clear the selection.
pub fn has_selection(&mut self) -> bool
pub fn selected(&self) -> HashSet<usize>
pub fn set_lead(&mut self, lead: Option<usize>, extend: bool)
sourcepub fn set_lead_clamped(&mut self, lead: usize, max: usize, extend: bool)
pub fn set_lead_clamped(&mut self, lead: usize, max: usize, extend: bool)
Set a new lead, at the same time limit the lead to max.
sourcepub fn add_selected(&mut self, idx: usize)
pub fn add_selected(&mut self, idx: usize)
Add to selection.
sourcepub fn remove_selected(&mut self, idx: usize)
pub fn remove_selected(&mut self, idx: usize)
Remove from selection. Only works for retired selections, not for the active anchor-lead range.
source§impl RTableState<CellSelection>
impl RTableState<CellSelection>
pub fn clear_selection(&mut self)
pub fn has_selection(&mut self) -> bool
sourcepub fn select_cell(&mut self, select: Option<(usize, usize)>)
pub fn select_cell(&mut self, select: Option<(usize, usize)>)
Select a cell.
sourcepub fn select_row(&mut self, select: Option<usize>)
pub fn select_row(&mut self, select: Option<usize>)
Select a row. Column stays the same.
sourcepub fn select_column(&mut self, select: Option<usize>)
pub fn select_column(&mut self, select: Option<usize>)
Select a column, row stays the same.
Trait Implementations§
source§impl<Selection: Clone> Clone for RTableState<Selection>
impl<Selection: Clone> Clone for RTableState<Selection>
source§fn clone(&self) -> RTableState<Selection>
fn clone(&self) -> RTableState<Selection>
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<Selection: Debug> Debug for RTableState<Selection>
impl<Selection: Debug> Debug for RTableState<Selection>
source§impl<Selection: Default> Default for RTableState<Selection>
impl<Selection: Default> Default for RTableState<Selection>
source§impl<Selection> HandleEvent<Event, DoubleClick, DoubleClickOutcome> for RTableState<Selection>
impl<Selection> HandleEvent<Event, DoubleClick, DoubleClickOutcome> for RTableState<Selection>
source§fn handle(&mut self, event: &Event, _keymap: DoubleClick) -> DoubleClickOutcome
fn handle(&mut self, event: &Event, _keymap: DoubleClick) -> DoubleClickOutcome
Handle an event. Read more
source§impl<Selection> HandleEvent<Event, EditKeys, EditOutcome> for RTableState<Selection>where
FTableState<Selection>: HandleEvent<Event, MouseOnly, Outcome> + HandleEvent<Event, FocusKeys, Outcome> + HandleEvent<Event, EditKeys, EditOutcome>,
impl<Selection> HandleEvent<Event, EditKeys, EditOutcome> for RTableState<Selection>where
FTableState<Selection>: HandleEvent<Event, MouseOnly, Outcome> + HandleEvent<Event, FocusKeys, Outcome> + HandleEvent<Event, EditKeys, EditOutcome>,
source§impl HandleEvent<Event, FocusKeys, Outcome> for RTableState<CellSelection>
impl HandleEvent<Event, FocusKeys, Outcome> for RTableState<CellSelection>
source§impl HandleEvent<Event, FocusKeys, Outcome> for RTableState<NoSelection>
impl HandleEvent<Event, FocusKeys, Outcome> for RTableState<NoSelection>
source§impl HandleEvent<Event, FocusKeys, Outcome> for RTableState<RowSelection>
impl HandleEvent<Event, FocusKeys, Outcome> for RTableState<RowSelection>
source§impl HandleEvent<Event, FocusKeys, Outcome> for RTableState<RowSetSelection>
impl HandleEvent<Event, FocusKeys, Outcome> for RTableState<RowSetSelection>
source§impl HandleEvent<Event, MouseOnly, Outcome> for RTableState<CellSelection>
impl HandleEvent<Event, MouseOnly, Outcome> for RTableState<CellSelection>
source§impl HandleEvent<Event, MouseOnly, Outcome> for RTableState<NoSelection>
impl HandleEvent<Event, MouseOnly, Outcome> for RTableState<NoSelection>
source§impl HandleEvent<Event, MouseOnly, Outcome> for RTableState<RowSelection>
impl HandleEvent<Event, MouseOnly, Outcome> for RTableState<RowSelection>
source§impl HandleEvent<Event, MouseOnly, Outcome> for RTableState<RowSetSelection>
impl HandleEvent<Event, MouseOnly, Outcome> for RTableState<RowSetSelection>
source§impl<Selection> HasFocusFlag for RTableState<Selection>
impl<Selection> HasFocusFlag for RTableState<Selection>
source§impl<Selection: TableSelection> ScrollingState for RTableState<Selection>
impl<Selection: TableSelection> ScrollingState for RTableState<Selection>
source§fn vertical_max_offset(&self) -> usize
fn vertical_max_offset(&self) -> usize
Maximum offset that is accessible with scrolling. Read more
source§fn vertical_offset(&self) -> usize
fn vertical_offset(&self) -> usize
Current vertical offset.
source§fn vertical_page(&self) -> usize
fn vertical_page(&self) -> usize
Vertical page-size at the current offset.
source§fn vertical_scroll(&self) -> usize
fn vertical_scroll(&self) -> usize
Suggested scroll per scroll-event.
source§fn horizontal_max_offset(&self) -> usize
fn horizontal_max_offset(&self) -> usize
Maximum offset that is accessible with scrolling. Read more
source§fn horizontal_offset(&self) -> usize
fn horizontal_offset(&self) -> usize
Current horizontal offset.
source§fn horizontal_page(&self) -> usize
fn horizontal_page(&self) -> usize
Horizontal page-size at the current offset.
source§fn horizontal_scroll(&self) -> usize
fn horizontal_scroll(&self) -> usize
Suggested scroll per scroll-event.
source§fn set_vertical_offset(&mut self, offset: usize) -> bool
fn set_vertical_offset(&mut self, offset: usize) -> bool
Change the vertical offset. Read more
source§fn set_horizontal_offset(&mut self, offset: usize) -> bool
fn set_horizontal_offset(&mut self, offset: usize) -> bool
Change the horizontal offset. Read more
source§fn scroll_up(&mut self, n: usize) -> bool
fn scroll_up(&mut self, n: usize) -> bool
Scroll up by n items.
The widget returns true if the offset changed at all.
source§fn scroll_down(&mut self, n: usize) -> bool
fn scroll_down(&mut self, n: usize) -> bool
Scroll down by n items.
The widget returns true if the offset changed at all.
source§fn scroll_left(&mut self, n: usize) -> bool
fn scroll_left(&mut self, n: usize) -> bool
Scroll up by n items.
The widget returns true if the offset changed at all.
source§fn scroll_right(&mut self, n: usize) -> bool
fn scroll_right(&mut self, n: usize) -> bool
Scroll down by n items.
The widget returns true if the offset changed at all.
source§impl<'a, Selection> ScrollingWidget<RTableState<Selection>> for RTable<'a, Selection>
impl<'a, Selection> ScrollingWidget<RTableState<Selection>> for RTable<'a, Selection>
source§fn need_scroll(
&self,
area: Rect,
_state: &mut RTableState<Selection>,
) -> (bool, bool)
fn need_scroll( &self, area: Rect, _state: &mut RTableState<Selection>, ) -> (bool, bool)
Widget wants a (horizontal, vertical) scrollbar.
This gets combined with the ScrollbarPolicy.
Auto Trait Implementations§
impl<Selection> !Freeze for RTableState<Selection>
impl<Selection> !RefUnwindSafe for RTableState<Selection>
impl<Selection> Send for RTableState<Selection>where
Selection: Send,
impl<Selection> !Sync for RTableState<Selection>
impl<Selection> Unpin for RTableState<Selection>where
Selection: Unpin,
impl<Selection> UnwindSafe for RTableState<Selection>where
Selection: UnwindSafe,
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> 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