summaryrefslogtreecommitdiff
path: root/FL/Fl_Table_Row.H
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2020-07-01 18:03:10 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2020-07-06 20:28:20 +0200
commitf09e17c3c564e8310125a10c03397cbf473ff643 (patch)
tree8d0fd4a28e3686c33aaa140d07ddba26ab28bdc2 /FL/Fl_Table_Row.H
parentb0e0c355edaa2e23148cb0260ada907aec930f05 (diff)
Remove $Id$ tags, update URL's, and more
- remove obsolete svn '$Id$' tags from all source files - update .fl files and generated files accordingly - replace 'http://www.fltk.org' URL's with 'https://...' - replace bug report URL 'str.php' with 'bugs.php' - remove trailing whitespace - fix other whitespace errors flagged by Git - add and/or fix missing or wrong standard headers - convert tabs to spaces in all source files The only relevant code changes are in the fluid/ folder where some .fl files and other source files were used to generate the '$Id' headers and footers.
Diffstat (limited to 'FL/Fl_Table_Row.H')
-rw-r--r--FL/Fl_Table_Row.H98
1 files changed, 47 insertions, 51 deletions
diff --git a/FL/Fl_Table_Row.H b/FL/Fl_Table_Row.H
index 0a8fcca8f..655efab81 100644
--- a/FL/Fl_Table_Row.H
+++ b/FL/Fl_Table_Row.H
@@ -1,12 +1,10 @@
//
-// "$Id$"
-//
#ifndef _FL_TABLE_ROW_H
#define _FL_TABLE_ROW_H
//
-// Fl_Table_Row -- A row oriented table widget
+// Fl_Table_Row -- A row oriented table widget for the Fast Light Tool Kit (FLTK).
//
// A class specializing in a table of rows.
// Handles row-specific selection behavior.
@@ -17,37 +15,39 @@
// the file "COPYING" which should have been included with this file. If this
// file is missing or damaged, see the license at:
//
-// http://www.fltk.org/COPYING.php
+// https://www.fltk.org/COPYING.php
+//
+// Please see the following page on how to report bugs and issues:
//
-// Please report all bugs and problems to "erco at seriss dot com".
+// https://www.fltk.org/bugs.php
//
#include <FL/Fl_Table.H>
/**
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 \em 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
+
+ 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().
*/
class FL_EXPORT Fl_Table_Row : public Fl_Table {
public:
enum TableRowSelectMode {
- SELECT_NONE, // no selection allowed
- SELECT_SINGLE, // single row selection
- SELECT_MULTI // multiple row selection (default)
- };
+ SELECT_NONE, // no selection allowed
+ SELECT_SINGLE, // single row selection
+ SELECT_MULTI // multiple row selection (default)
+ };
private:
// An STL-ish vector without templates
class FL_EXPORT CharVector {
@@ -59,15 +59,15 @@ private:
}
void copy(char *newarr, int newsize);
public:
- CharVector() { // CTOR
+ CharVector() { // CTOR
init();
}
- ~CharVector(); // DTOR
- CharVector(CharVector&o) { // COPY CTOR
+ ~CharVector(); // DTOR
+ CharVector(CharVector&o) { // COPY CTOR
init();
copy(o.arr, o._size);
}
- CharVector& operator=(CharVector&o) { // ASSIGN
+ CharVector& operator=(CharVector&o) { // ASSIGN
init();
copy(o.arr, o._size);
return(*this);
@@ -97,33 +97,33 @@ private:
}
};
- CharVector _rowselect; // selection flag for each row
-
+ CharVector _rowselect; // selection flag for each row
+
// handle() state variables.
// Put here instead of local statics in handle(), so more
// than one instance can exist without crosstalk between.
//
- int _dragging_select; // dragging out a selection?
+ int _dragging_select; // dragging out a selection?
int _last_row;
- int _last_y; // last event's Y position
- int _last_push_x; // last PUSH event's X position
- int _last_push_y; // last PUSH event's Y position
-
+ int _last_y; // last event's Y position
+ int _last_push_x; // last PUSH event's X position
+ int _last_push_y; // last PUSH event's Y position
+
TableRowSelectMode _selectmode;
-
+
protected:
int handle(int event);
- int find_cell(TableContext context, // find cell's x/y/w/h given r/c
+ int find_cell(TableContext context, // find cell's x/y/w/h given r/c
int R, int C, int &X, int &Y, int &W, int &H) {
return(Fl_Table::find_cell(context, R, C, X, Y, W, H));
}
-
+
public:
/**
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(int X, int Y, int W, int H, const char *l=0) : Fl_Table(X,Y,W,H,l) {
_dragging_select = 0;
_last_row = -1;
@@ -132,60 +132,56 @@ public:
_last_push_y = -1;
_selectmode = SELECT_MULTI;
}
-
+
/**
The destructor for the Fl_Table_Row.
Destroys the table and its associated widgets.
*/
~Fl_Table_Row() { }
-
- void rows(int val); // set number of rows
- int rows() { // get number of rows
+
+ void rows(int val); // set number of rows
+ int rows() { // get number of rows
return(Fl_Table::rows());
}
-
+
/**
Sets the table selection mode.
-
+
- \p Fl_Table_Row::SELECT_NONE - No selection allowed
- \p Fl_Table_Row::SELECT_SINGLE - Only single rows can be selected
- \p Fl_Table_Row::SELECT_MULTI - Multiple rows can be selected
*/
- void type(TableRowSelectMode val); // set selection mode
-
- TableRowSelectMode type() const { // get selection mode
+ void type(TableRowSelectMode val); // set selection mode
+
+ TableRowSelectMode type() const { // get selection mode
return(_selectmode);
}
-
+
/**
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)
*/
- int row_selected(int row); // is row selected? (0=no, 1=yes, -1=range err)
-
+ int row_selected(int row); // is row selected? (0=no, 1=yes, -1=range err)
+
/**
Changes the selection state for 'row', depending on the value
of 'flag'. 0=deselected, 1=select, 2=toggle existing state.
*/
- int select_row(int row, int flag=1); // select state for row: flag:0=off, 1=on, 2=toggle
+ int select_row(int row, int flag=1); // select state for row: flag:0=off, 1=on, 2=toggle
// returns: 0=no change, 1=changed, -1=range err
-
+
/**
- This convenience function changes the selection state
+ This convenience function changes the selection state
for \em all rows based on 'flag'. 0=deselect, 1=select, 2=toggle existing state.
*/
- void select_all_rows(int flag=1); // all rows to a known state
-
+ void select_all_rows(int flag=1); // all rows to a known state
+
void clear() {
- rows(0); // implies clearing selection
+ rows(0); // implies clearing selection
cols(0);
- Fl_Table::clear(); // clear the table
+ Fl_Table::clear(); // clear the table
}
};
#endif /*_FL_TABLE_ROW_H*/
-
-//
-// End of "$Id$".
-//