FLTK 1.3.0
Fl_Table_Row Class Reference

A table with row selection capabilities. More...

#include <Fl_Table_Row.H>

Inheritance diagram for Fl_Table_Row:
Fl_Table Fl_Group Fl_Widget

List of all members.

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.
int rows ()
 Returns the number of rows in the table.
void rows (int val)
 Sets the number of rows in the table, and the table is redrawn.
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'.
TableRowSelectMode type () const
 Gets the widget type.
void type (TableRowSelectMode val)
 Sets the table selection mode.
 ~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.

Detailed Description

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().


Constructor & Destructor Documentation

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.


Member Function Documentation

void Fl_Table_Row::clear ( ) [inline, virtual]

Clears the table to zero rows, zero columns.

Same as rows(0); cols(0);

See also:
rows(int), cols(int)

Reimplemented from Fl_Table.

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.

Parameters:
[in]eventthe kind of event received
Return values:
0if the event was not used or understood
1if the event was used and can be deleted
See also:
Fl_Event

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.

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.

Todo:
Explain "simulate RTTI" (currently only used to decide if a widget is a window, i.e. type()>=FL_WINDOW ?). Is type() really used in a way that ensures "Forms compatibility" ?

Reimplemented from Fl_Widget.

void Fl_Table_Row::type ( TableRowSelectMode  val)

Sets the table selection mode.

  • Fl_Table_Row::SELECT_NONE - No selection allowed
  • Fl_Table_Row::SELECT_SINGLE - Only single rows can be selected
  • Fl_Table_Row::SELECT_MULTI - Multiple rows can be selected

The documentation for this class was generated from the following files: