Struct rat_ftable::FTableState
source · pub struct FTableState<Selection> {Show 18 fields
pub area: Rect,
pub header_area: Rect,
pub table_area: Rect,
pub row_areas: Vec<Rect>,
pub column_areas: Vec<Rect>,
pub footer_area: Rect,
pub rows: usize,
pub _counted_rows: usize,
pub columns: usize,
pub row_offset: usize,
pub col_offset: usize,
pub row_page_len: usize,
pub col_page_len: usize,
pub max_row_offset: usize,
pub max_col_offset: usize,
pub selection: Selection,
pub mouse: MouseFlags,
pub non_exhaustive: NonExhaustive,
}Expand description
FTable state.
Fields§
§area: RectTotal area.
header_area: RectTotal header area.
table_area: RectTotal table area.
row_areas: Vec<Rect>Area per visible row.
column_areas: Vec<Rect>Area per visible column, also contains the following spacer if any.
Total footer area.
rows: usizeRow count.
_counted_rows: usize§columns: usizeColumn count.
row_offset: usizeCurrent row offset. Automatically capped at rows-1.
col_offset: usizeCurrent column offset. Automatically capped at columns-1.
row_page_len: usizeCurrent page len as items.
col_page_len: usizeCurrent page width as columns.
max_row_offset: usizeMaximum offset for row-scrolling. Can be set higher, but this offset guarantees a full page display.
max_col_offset: usizeMaximum offset for column-scrolling. Can be set higher, but this offset guarantees a full page display.
selection: SelectionSelection data.
mouse: MouseFlagsHelper for mouse interactions.
non_exhaustive: NonExhaustiveImplementations§
source§impl<Selection: TableSelection> FTableState<Selection>
impl<Selection: TableSelection> FTableState<Selection>
sourcepub fn column_at_clicked(&self, pos: Position) -> Option<usize>
pub fn column_at_clicked(&self, pos: Position) -> Option<usize>
Column at given position.
sourcepub fn row_at_clicked(&self, pos: Position) -> Option<usize>
pub fn row_at_clicked(&self, pos: Position) -> Option<usize>
Row at given position.
sourcepub fn cell_at_drag(&self, pos: Position) -> (usize, usize)
pub fn cell_at_drag(&self, pos: Position) -> (usize, usize)
Cell when dragging. Can go outside the area.
sourcepub fn row_at_drag(&self, pos: Position) -> usize
pub fn row_at_drag(&self, pos: Position) -> usize
Row when dragging. Can go outside the area.
sourcepub fn column_at_drag(&self, pos: Position) -> usize
pub fn column_at_drag(&self, pos: Position) -> usize
Column when dragging. Can go outside the area.
source§impl<Selection: TableSelection> FTableState<Selection>
impl<Selection: TableSelection> FTableState<Selection>
sourcepub fn vertical_max_offset(&self) -> usize
pub fn vertical_max_offset(&self) -> usize
Maximum offset that is accessible with scrolling.
This is shorter than the length of the content by whatever fills the last page. This is the base for the scrollbar content_length.
sourcepub fn vertical_offset(&self) -> usize
pub fn vertical_offset(&self) -> usize
Current vertical offset.
sourcepub fn vertical_page(&self) -> usize
pub fn vertical_page(&self) -> usize
Vertical page-size at the current offset.
sourcepub fn vertical_scroll(&self) -> usize
pub fn vertical_scroll(&self) -> usize
Suggested scroll per scroll-event.
sourcepub fn horizontal_max_offset(&self) -> usize
pub fn horizontal_max_offset(&self) -> usize
Maximum offset that is accessible with scrolling.
This is shorter than the length of the content by whatever fills the last page. This is the base for the scrollbar content_length.
sourcepub fn horizontal_offset(&self) -> usize
pub fn horizontal_offset(&self) -> usize
Current horizontal offset.
sourcepub fn horizontal_page(&self) -> usize
pub fn horizontal_page(&self) -> usize
Horizontal page-size at the current offset.
sourcepub fn horizontal_scroll(&self) -> usize
pub fn horizontal_scroll(&self) -> usize
Suggested scroll per scroll-event.
sourcepub fn set_vertical_offset(&mut self, offset: usize) -> bool
pub fn set_vertical_offset(&mut self, offset: usize) -> bool
Change the vertical offset.
Due to overscroll it’s possible that this is an invalid offset for the widget. The widget must deal with this situation.
The widget returns true if the offset changed at all.
sourcepub fn set_horizontal_offset(&mut self, offset: usize) -> bool
pub fn set_horizontal_offset(&mut self, offset: usize) -> bool
Change the horizontal offset.
Due to overscroll it’s possible that this is an invalid offset for the widget. The widget must deal with this situation.
The widget returns true if the offset changed at all.
sourcepub fn scroll_up(&mut self, n: usize) -> bool
pub fn scroll_up(&mut self, n: usize) -> bool
Scroll up by n items. The widget returns true if the offset changed at all.
sourcepub fn scroll_down(&mut self, n: usize) -> bool
pub fn scroll_down(&mut self, n: usize) -> bool
Scroll down by n items. The widget returns true if the offset changed at all.
sourcepub fn scroll_left(&mut self, n: usize) -> bool
pub fn scroll_left(&mut self, n: usize) -> bool
Scroll up by n items. The widget returns true if the offset changed at all.
sourcepub fn scroll_right(&mut self, n: usize) -> bool
pub fn scroll_right(&mut self, n: usize) -> bool
Scroll down by n items. The widget returns true if the offset changed at all.
sourcepub fn scroll_to_selected(&mut self)
pub fn scroll_to_selected(&mut self)
Scroll to selected.
source§impl FTableState<RowSetSelection>
impl FTableState<RowSetSelection>
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 clear_selection(&mut self)
pub fn clear_selection(&mut self)
Clear the selection.
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 FTableState<CellSelection>
impl FTableState<CellSelection>
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.
Trait Implementations§
source§impl<Selection: Clone> Clone for FTableState<Selection>
impl<Selection: Clone> Clone for FTableState<Selection>
source§fn clone(&self) -> FTableState<Selection>
fn clone(&self) -> FTableState<Selection>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<Selection: Debug> Debug for FTableState<Selection>
impl<Selection: Debug> Debug for FTableState<Selection>
source§impl<Selection: Default> Default for FTableState<Selection>
impl<Selection: Default> Default for FTableState<Selection>
source§impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<CellSelection>
impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<CellSelection>
source§impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<NoSelection>
impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<NoSelection>
source§impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<RowSelection>
impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<RowSelection>
source§impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<RowSetSelection>
impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<RowSetSelection>
source§impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<CellSelection>
impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<CellSelection>
source§impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<NoSelection>
impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<NoSelection>
source§impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<RowSelection>
impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<RowSelection>
source§impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<RowSetSelection>
impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<RowSetSelection>
Auto Trait Implementations§
impl<Selection> !Freeze for FTableState<Selection>
impl<Selection> !RefUnwindSafe for FTableState<Selection>
impl<Selection> Send for FTableState<Selection>where
Selection: Send,
impl<Selection> !Sync for FTableState<Selection>
impl<Selection> Unpin for FTableState<Selection>where
Selection: Unpin,
impl<Selection> UnwindSafe for FTableState<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
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>
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>
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