[−][src]Struct unsegen::widget::builtin::table::Table
A table of widgets with static number of Columns
.
In order to create a table, you have to define a type for a row in the table and implement
TableRow
for it. Then add instances of that type using rows_mut
.
At any time, a single cell of the table is active. Send user input to the cell by adding the
result of current_cell_behavior()
to an InputChain
.
A table is also Navigatable
by which the user can change which cell is the currently active
one.
Implementations
impl<R: TableRow + 'static> Table<R>
[src]
pub fn new(
row_sep_style: SeparatingStyle,
col_sep_style: SeparatingStyle,
focused_style: StyleModifier
) -> Self
[src]
row_sep_style: SeparatingStyle,
col_sep_style: SeparatingStyle,
focused_style: StyleModifier
) -> Self
Create an empty table and specify how rows/columns and the currently active cell will be distinguished.
pub fn rows_mut<'a>(&'a mut self) -> RowsMut<'a, R>
[src]
Access the content of the table mutably.
pub fn rows(&mut self) -> &Vec<R>
[src]
Access the content of the table immutably.
pub fn current_row(&self) -> Option<&R>
[src]
Get access to the currently active row.
pub fn current_row_mut(&mut self) -> Option<&mut R>
[src]
Get mutable access to the currently active row.
pub fn current_col(&self) -> &'static Column<R>
[src]
Get the currently active column.
pub fn current_cell_behavior<'a>(&'a mut self) -> CurrentCellBehavior<'a, R>
[src]
Create a Behavior
which can be used to send input directly to the currently active cell
by adding it to an InputChain
.
Trait Implementations
impl<R: TableRow + 'static> Navigatable for Table<R>
[src]
fn move_up(&mut self) -> OperationResult
[src]
fn move_down(&mut self) -> OperationResult
[src]
fn move_left(&mut self) -> OperationResult
[src]
fn move_right(&mut self) -> OperationResult
[src]
impl<R: TableRow + 'static> Scrollable for Table<R>
[src]
fn scroll_backwards(&mut self) -> OperationResult
[src]
fn scroll_forwards(&mut self) -> OperationResult
[src]
fn scroll_to_beginning(&mut self) -> OperationResult
[src]
fn scroll_to_end(&mut self) -> OperationResult
[src]
impl<R: TableRow + 'static> Widget for Table<R>
[src]
fn space_demand(&self) -> Demand2D
[src]
fn draw(&self, window: Window<'_>, hints: RenderingHints)
[src]
Auto Trait Implementations
impl<R> RefUnwindSafe for Table<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for Table<R> where
R: Send,
R: Send,
impl<R> Sync for Table<R> where
R: Sync,
R: Sync,
impl<R> Unpin for Table<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for Table<R> where
R: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,