pub unsafe trait TableExt: GroupExt {
Show 61 methods
// Required methods
fn clear(&mut self);
fn set_table_frame(&mut self, frame: FrameType);
fn table_frame(&self) -> FrameType;
fn set_rows(&mut self, val: i32);
fn rows(&self) -> i32;
fn set_cols(&mut self, val: i32);
fn cols(&self) -> i32;
fn visible_cells(&self) -> (i32, i32, i32, i32);
fn try_visible_cells(&self) -> Option<(i32, i32, i32, i32)>;
fn is_interactive_resize(&self) -> bool;
fn row_resize(&self) -> bool;
fn set_row_resize(&mut self, flag: bool);
fn col_resize(&self) -> bool;
fn set_col_resize(&mut self, flag: bool);
fn col_resize_min(&self) -> i32;
fn set_col_resize_min(&mut self, val: i32);
fn row_resize_min(&self) -> i32;
fn set_row_resize_min(&mut self, val: i32);
fn row_header(&self) -> bool;
fn set_row_header(&mut self, flag: bool);
fn col_header(&self) -> bool;
fn set_col_header(&mut self, flag: bool);
fn set_col_header_height(&mut self, height: i32);
fn col_header_height(&self) -> i32;
fn set_row_header_width(&mut self, width: i32);
fn row_header_width(&self) -> i32;
fn set_row_header_color(&mut self, val: Color);
fn row_header_color(&self) -> Color;
fn set_col_header_color(&mut self, val: Color);
fn col_header_color(&self) -> Color;
fn set_row_height(&mut self, row: i32, height: i32);
fn row_height(&self, row: i32) -> i32;
fn set_col_width(&mut self, col: i32, width: i32);
fn col_width(&self, col: i32) -> i32;
fn set_row_height_all(&mut self, height: i32);
fn set_col_width_all(&mut self, width: i32);
fn set_row_position(&mut self, row: i32);
fn set_col_position(&mut self, col: i32);
fn row_position(&self) -> i32;
fn col_position(&self) -> i32;
fn set_top_row(&mut self, row: i32);
fn top_row(&self) -> i32;
fn is_selected(&self, r: i32, c: i32) -> bool;
fn get_selection(&self) -> (i32, i32, i32, i32);
fn try_get_selection(&self) -> Option<(i32, i32, i32, i32)>;
fn set_selection(
&mut self,
row_top: i32,
col_left: i32,
row_bot: i32,
col_right: i32
);
fn unset_selection(&mut self);
fn move_cursor_with_shift_select(
&mut self,
r: i32,
c: i32,
shiftselect: bool
) -> Result<(), FltkError>;
fn move_cursor(&mut self, r: i32, c: i32) -> Result<(), FltkError>;
fn scrollbar_size(&self) -> i32;
fn set_scrollbar_size(&mut self, new_size: i32);
fn set_tab_cell_nav(&mut self, val: bool);
fn tab_cell_nav(&self) -> bool;
fn draw_cell<F: FnMut(&mut Self, TableContext, i32, i32, i32, i32, i32, i32) + 'static>(
&mut self,
cb: F
);
fn callback_col(&self) -> i32;
fn callback_row(&self) -> i32;
fn callback_context(&self) -> TableContext;
fn scrollbar(&self) -> Scrollbar;
fn hscrollbar(&self) -> Scrollbar;
fn find_cell(
&self,
ctx: TableContext,
row: i32,
col: i32
) -> Option<(i32, i32, i32, i32)>;
fn cursor2rowcol(&self) -> Option<(TableContext, i32, i32, TableResizeFlag)>;
}
Expand description
Defines the methods implemented by table types. More details can be found in the wiki.
Safety
fltk-rs traits depend on some FLTK internal code
Warning
fltk-rs traits are non-exhaustive,
to avoid future breakage if you try to implement them manually,
use the Deref and DerefMut pattern or the widget_extends!
macro
Required Methods§
sourcefn set_table_frame(&mut self, frame: FrameType)
fn set_table_frame(&mut self, frame: FrameType)
Sets the table frame
sourcefn table_frame(&self) -> FrameType
fn table_frame(&self) -> FrameType
Gets the table frame
sourcefn visible_cells(&self) -> (i32, i32, i32, i32)
fn visible_cells(&self) -> (i32, i32, i32, i32)
The range of row and column numbers for all visible and partially visible cells in the table.
Returns (row_top
, col_left
, row_bot
, col_right
)
sourcefn try_visible_cells(&self) -> Option<(i32, i32, i32, i32)>
fn try_visible_cells(&self) -> Option<(i32, i32, i32, i32)>
The range of row and column numbers for all visible and partially visible cells in the table.
Returns (row_top
, col_left
, row_bot
, col_right
)
sourcefn is_interactive_resize(&self) -> bool
fn is_interactive_resize(&self) -> bool
Returns whether the resize is interactive
sourcefn row_resize(&self) -> bool
fn row_resize(&self) -> bool
Returns whether a row is resizable
sourcefn set_row_resize(&mut self, flag: bool)
fn set_row_resize(&mut self, flag: bool)
Sets a row to be resizable
sourcefn col_resize(&self) -> bool
fn col_resize(&self) -> bool
Returns whether a column is resizable
sourcefn set_col_resize(&mut self, flag: bool)
fn set_col_resize(&mut self, flag: bool)
Sets a column to be resizable
sourcefn col_resize_min(&self) -> i32
fn col_resize_min(&self) -> i32
Returns the current column minimum resize value.
sourcefn set_col_resize_min(&mut self, val: i32)
fn set_col_resize_min(&mut self, val: i32)
Sets the current column minimum resize value.
sourcefn row_resize_min(&self) -> i32
fn row_resize_min(&self) -> i32
Returns the current row minimum resize value.
sourcefn set_row_resize_min(&mut self, val: i32)
fn set_row_resize_min(&mut self, val: i32)
Sets the current row minimum resize value.
sourcefn row_header(&self) -> bool
fn row_header(&self) -> bool
Returns if row headers are enabled or not
sourcefn set_row_header(&mut self, flag: bool)
fn set_row_header(&mut self, flag: bool)
Sets whether a row headers are enabled or not
sourcefn col_header(&self) -> bool
fn col_header(&self) -> bool
Returns if column headers are enabled or not
sourcefn set_col_header(&mut self, flag: bool)
fn set_col_header(&mut self, flag: bool)
Sets whether a column headers are enabled or not
sourcefn set_col_header_height(&mut self, height: i32)
fn set_col_header_height(&mut self, height: i32)
Sets the column header height
sourcefn col_header_height(&self) -> i32
fn col_header_height(&self) -> i32
Gets the column header height
sourcefn set_row_header_width(&mut self, width: i32)
fn set_row_header_width(&mut self, width: i32)
Sets the row header width
sourcefn row_header_width(&self) -> i32
fn row_header_width(&self) -> i32
Gets the row header width
sourcefn set_row_header_color(&mut self, val: Color)
fn set_row_header_color(&mut self, val: Color)
Sets the row header color
sourcefn row_header_color(&self) -> Color
fn row_header_color(&self) -> Color
Gets the row header color
sourcefn set_col_header_color(&mut self, val: Color)
fn set_col_header_color(&mut self, val: Color)
Sets the column header color
sourcefn col_header_color(&self) -> Color
fn col_header_color(&self) -> Color
Gets the row header color
sourcefn set_row_height(&mut self, row: i32, height: i32)
fn set_row_height(&mut self, row: i32, height: i32)
Sets the row’s height
sourcefn row_height(&self, row: i32) -> i32
fn row_height(&self, row: i32) -> i32
Gets the row’s height
sourcefn set_col_width(&mut self, col: i32, width: i32)
fn set_col_width(&mut self, col: i32, width: i32)
Sets the column’s width
sourcefn set_row_height_all(&mut self, height: i32)
fn set_row_height_all(&mut self, height: i32)
Sets all rows height
sourcefn set_col_width_all(&mut self, width: i32)
fn set_col_width_all(&mut self, width: i32)
Sets all column’s width
sourcefn set_row_position(&mut self, row: i32)
fn set_row_position(&mut self, row: i32)
Sets the row’s position
sourcefn set_col_position(&mut self, col: i32)
fn set_col_position(&mut self, col: i32)
Sets the column’s position
sourcefn row_position(&self) -> i32
fn row_position(&self) -> i32
Gets the row’s position
sourcefn col_position(&self) -> i32
fn col_position(&self) -> i32
Gets the column’s position
sourcefn set_top_row(&mut self, row: i32)
fn set_top_row(&mut self, row: i32)
Sets the top row
sourcefn is_selected(&self, r: i32, c: i32) -> bool
fn is_selected(&self, r: i32, c: i32) -> bool
Returns whether a cell is selected
sourcefn get_selection(&self) -> (i32, i32, i32, i32)
fn get_selection(&self) -> (i32, i32, i32, i32)
Gets the selection.
Returns (row_top
, col_left
, row_bot
, col_right
).
Returns -1 if no selection.
sourcefn try_get_selection(&self) -> Option<(i32, i32, i32, i32)>
fn try_get_selection(&self) -> Option<(i32, i32, i32, i32)>
Tries to get the selection.
Returns an Option((row_top
, col_left
, row_bot
, col_right
))
sourcefn set_selection(
&mut self,
row_top: i32,
col_left: i32,
row_bot: i32,
col_right: i32
)
fn set_selection( &mut self, row_top: i32, col_left: i32, row_bot: i32, col_right: i32 )
Sets the selection
sourcefn unset_selection(&mut self)
fn unset_selection(&mut self)
Unset selection
sourcefn move_cursor_with_shift_select(
&mut self,
r: i32,
c: i32,
shiftselect: bool
) -> Result<(), FltkError>
fn move_cursor_with_shift_select( &mut self, r: i32, c: i32, shiftselect: bool ) -> Result<(), FltkError>
sourcefn scrollbar_size(&self) -> i32
fn scrollbar_size(&self) -> i32
Returns the scrollbar size
sourcefn set_scrollbar_size(&mut self, new_size: i32)
fn set_scrollbar_size(&mut self, new_size: i32)
Sets the scrollbar size
Sets whether tab key cell navigation is enabled
Returns whether tab key cell navigation is enabled
sourcefn draw_cell<F: FnMut(&mut Self, TableContext, i32, i32, i32, i32, i32, i32) + 'static>(
&mut self,
cb: F
)
fn draw_cell<F: FnMut(&mut Self, TableContext, i32, i32, i32, i32, i32, i32) + 'static>( &mut self, cb: F )
Override draw_cell
.
callback args: &mut self, TableContext
, Row: i32, Column: i32, X: i32, Y: i32, Width: i32 and Height: i32.
takes the widget as a closure argument
sourcefn callback_col(&self) -> i32
fn callback_col(&self) -> i32
Get the callback column, should be called from within a callback
sourcefn callback_row(&self) -> i32
fn callback_row(&self) -> i32
Get the callback row, should be called from within a callback
sourcefn callback_context(&self) -> TableContext
fn callback_context(&self) -> TableContext
Get the callback context, should be called from within a callback
sourcefn hscrollbar(&self) -> Scrollbar
fn hscrollbar(&self) -> Scrollbar
Returns the table’s horizontal scrollbar
sourcefn find_cell(
&self,
ctx: TableContext,
row: i32,
col: i32
) -> Option<(i32, i32, i32, i32)>
fn find_cell( &self, ctx: TableContext, row: i32, col: i32 ) -> Option<(i32, i32, i32, i32)>
Find a cell’s coords and size by row and column
sourcefn cursor2rowcol(&self) -> Option<(TableContext, i32, i32, TableResizeFlag)>
fn cursor2rowcol(&self) -> Option<(TableContext, i32, i32, TableResizeFlag)>
Get the cursor to row/col