FLTK 1.3.0
|
A table with row selection capabilities. More...
#include <Fl_Table_Row.H>
Classes | |
class | CharVector |
Public Types | |
enum | TableRowSelectMode { SELECT_NONE, SELECT_SINGLE, SELECT_MULTI } |
Public Member Functions | |
void | clear () |
Clears the table to zero rows, zero columns. | |
Fl_Table_Row (int X, int Y, int W, int H, const char *l=0) | |
The constructor for the Fl_Table_Row. | |
int | row_selected (int row) |
Checks to see if 'row' is selected. | |
void | rows (int val) |
Sets the number of rows in the table, and the table is redrawn. | |
int | rows () |
Returns the number of rows in the table. | |
void | select_all_rows (int flag=1) |
This convenience function changes the selection state for all rows based on 'flag'. | |
int | select_row (int row, int flag=1) |
Changes the selection state for 'row', depending on the value of 'flag'. | |
void | type (TableRowSelectMode val) |
Sets the table selection mode. | |
TableRowSelectMode | type () const |
Gets the widget type. | |
~Fl_Table_Row () | |
The destructor for the Fl_Table_Row. | |
Protected Member Functions | |
int | find_cell (TableContext context, int R, int C, int &X, int &Y, int &W, int &H) |
int | handle (int event) |
Handles the specified event. |
A table with row selection capabilities.
This class implements a simple table with the ability to select rows. This widget is similar to an Fl_Browser with columns. Most methods of importance will be found in the Fl_Table widget, such as Fl_Table::rows() and Fl_Table::cols().
To be useful it must be subclassed and at minimum the draw_cell() method must be overridden to provide the content of the cells. This widget does not manage the cell's data content; it is up to the parent class's draw_cell() method override to provide this.
Events on the cells and/or headings generate callbacks when they are clicked by the user. You control when events are generated based on the values you supply for Fl_Table::when().
Fl_Table_Row::Fl_Table_Row | ( | int | X, |
int | Y, | ||
int | W, | ||
int | H, | ||
const char * | l = 0 |
||
) | [inline] |
The constructor for the Fl_Table_Row.
This creates an empty table with no rows or columns, with headers and row/column resize behavior disabled.
Fl_Table_Row::~Fl_Table_Row | ( | ) | [inline] |
The destructor for the Fl_Table_Row.
Destroys the table and its associated widgets.
void Fl_Table_Row::clear | ( | ) | [inline, virtual] |
int Fl_Table_Row::handle | ( | int | event | ) | [protected, virtual] |
Handles the specified event.
You normally don't call this method directly, but instead let FLTK do it when the user interacts with the widget.
When implemented in a widget, this function must return 0 if the widget does not use the event or 1 otherwise.
Most of the time, you want to call the inherited handle() method in your overridden method so that you don't short-circuit events that you don't handle. In this last case you should return the callee retval.
[in] | event | the kind of event received |
0 | if the event was not used or understood |
1 | if the event was used and can be deleted |
Reimplemented from Fl_Table.
int Fl_Table_Row::row_selected | ( | int | row | ) |
Checks to see if 'row' is selected.
Returns 1 if selected, 0 if not. You can change the selection of a row by clicking on it, or by using select_row(row, flag)
void Fl_Table_Row::select_all_rows | ( | int | flag = 1 | ) |
This convenience function changes the selection state for all rows based on 'flag'.
0=deselect, 1=select, 2=toggle existing state.
int Fl_Table_Row::select_row | ( | int | row, |
int | flag = 1 |
||
) |
Changes the selection state for 'row', depending on the value of 'flag'.
0=deselected, 1=select, 2=toggle existing state.
void Fl_Table_Row::type | ( | TableRowSelectMode | val | ) |
Sets the table selection mode.
Fl_Table_Row::SELECT_NONE
- No selection allowedFl_Table_Row::SELECT_SINGLE
- Only single rows can be selectedFl_Table_Row::SELECT_MULTI
- Multiple rows can be selected TableRowSelectMode Fl_Table_Row::type | ( | ) | const [inline] |
Gets the widget type.
Returns the widget type value, which is used for Forms compatibility and to simulate RTTI.
Reimplemented from Fl_Widget.