fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
  SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation)  

Fl_Table_Row Class Reference

#include <Fl_Table_Row.H>

Inheritance diagram for Fl_Table_Row:
Collaboration diagram for Fl_Table_Row:

List of all members.

Classes

class  CharVector

Public Types

enum  TableRowSelectMode { SELECT_NONE, SELECT_SINGLE, SELECT_MULTI }

Public Member Functions

 Fl_Table_Row (int X, int Y, int W, int H, const char *l=0)
 ~Fl_Table_Row ()
void rows (int val)
int rows ()
void type (TableRowSelectMode val)
TableRowSelectMode type () const
int row_selected (int row)
int select_row (int row, int flag=1)
void select_all_rows (int flag=1)
void clear ()

Protected Member Functions

int handle (int event)
int find_cell (TableContext context, int R, int C, int &X, int &Y, int &W, int &H)

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

Definition at line 54 of file Fl_Table_Row.H.


Member Enumeration Documentation

Enumerator:
SELECT_NONE 
SELECT_SINGLE 
SELECT_MULTI 

Definition at line 57 of file Fl_Table_Row.H.


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.

Definition at line 148 of file Fl_Table_Row.H.

Fl_Table_Row::~Fl_Table_Row ( ) [inline]

The destructor for the Fl_Table_Row. Destroys the table and its associated widgets.

Definition at line 161 of file Fl_Table_Row.H.


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.

Definition at line 201 of file Fl_Table_Row.H.

int Fl_Table_Row::find_cell ( TableContext  context,
int  R,
int  C,
int &  X,
int &  Y,
int &  W,
int &  H 
) [inline, protected]

Reimplemented from Fl_Table.

Definition at line 137 of file Fl_Table_Row.H.

References Fl_Table::find_cell().

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.

Definition at line 168 of file Fl_Table_Row.cxx.

References Fl_Table::botrow, Fl_Table::CONTEXT_CELL, Fl_Table::cursor2rowcol(), Fl::event_button(), Fl::event_state(), Fl::event_x(), Fl::event_y(), FL_CTRL, FL_DRAG, FL_PUSH, FL_RELEASE, FL_SHIFT, row, Fl_Table::row_position(), rows(), select_all_rows(), select_row(), Fl_Table::table_h, Fl_Table::table_w, Fl_Table::tix, Fl_Table::tiy, Fl_Table::toh, and Fl_Table::toy.

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)

Definition at line 39 of file Fl_Table_Row.cxx.

References rows().

int Fl_Table_Row::rows ( ) [inline]

Returns the number of rows in the table.

Reimplemented from Fl_Table.

Definition at line 164 of file Fl_Table_Row.H.

Referenced by handle(), row_selected(), rows(), select_row(), and type().

void Fl_Table_Row::rows ( int  val) [virtual]

Sets the number of rows in the table, and the table is redrawn.

Reimplemented from Fl_Table.

Definition at line 158 of file Fl_Table_Row.cxx.

References rows().

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.

Definition at line 128 of file Fl_Table_Row.cxx.

References Fl_Widget::changed(), flag, int, Fl_Widget::redraw(), row, SELECT_MULTI, SELECT_NONE, and SELECT_SINGLE.

Referenced by handle().

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.

Definition at line 84 of file Fl_Table_Row.cxx.

References Fl_Table::botrow, flag, Fl_Table::leftcol, Fl_Table::redraw_range(), Fl_Table::rightcol, row, rows(), SELECT_MULTI, SELECT_NONE, SELECT_SINGLE, and Fl_Table::toprow.

Referenced by handle().

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.

Definition at line 177 of file Fl_Table_Row.H.

void Fl_Table_Row::type ( TableRowSelectMode  val)

Sets the table selection mode.

Definition at line 45 of file Fl_Table_Row.cxx.

References Fl_Widget::redraw(), row, rows(), SELECT_MULTI, SELECT_NONE, SELECT_SINGLE, and val.


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