FLTK 1.4.4

Loading...
Searching...
No Matches
Fl_Table.H
1//
2// Fl_Table -- A table widget for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 2002 by Greg Ercolano.
5// Copyright (c) 2004 O'ksi'D
6// Copyright 2023 by Bill Spitzak and others.
7//
8// This library is free software. Distribution and use rights are outlined in
9// the file "COPYING" which should have been included with this file. If this
10// file is missing or damaged, see the license at:
11//
12// https://www.fltk.org/COPYING.php
13//
14// Please see the following page on how to report bugs and issues:
15//
16// https://www.fltk.org/bugs.php
17//
18
19#ifndef _FL_TABLE_H
20#define _FL_TABLE_H
21
22#include <FL/Fl_Group.H>
23#include <FL/Fl_Scroll.H>
24
25// EXPERIMENTAL
26// We use either std::vector or the private class Fl_Int_Vector
27// depending on the build option FLTK_OPTION_STD or --enable-use_std.
28// This option allows to use std::string and std::vector in FLTK 1.4.x
29
30#if (FLTK_USE_STD)
31#include <vector>
32 typedef std::vector<int> Fl_Int_Vector;
33#else
34 class Fl_Int_Vector; // private class declared in src/Fl_Int_Vector.H
35#endif
36
121 class FL_EXPORT Fl_Table : public Fl_Group {
122 public:
129 enum TableContext {
130 CONTEXT_NONE = 0,
131 CONTEXT_STARTPAGE = 0x01,
132 CONTEXT_ENDPAGE = 0x02,
133 CONTEXT_ROW_HEADER = 0x04,
134 CONTEXT_COL_HEADER = 0x08,
135 CONTEXT_CELL = 0x10,
136 CONTEXT_TABLE = 0x20,
137 CONTEXT_RC_RESIZE = 0x40
138 };
139
140 private:
141 int _rows, _cols; // total rows/cols
142 int _row_header_w; // width of row header
143 int _col_header_h; // height of column header
144 int _row_position; // last row_position set (not necessarily == toprow!)
145 int _col_position; // last col_position set (not necessarily == leftcol!)
146
147 char _row_header; // row header enabled?
148 char _col_header; // col header enabled?
149 char _row_resize; // row resizing enabled?
150 char _col_resize; // col resizing enabled?
151 int _row_resize_min; // row minimum resizing height (default=1)
152 int _col_resize_min; // col minimum resizing width (default=1)
153
154 // OPTIMIZATION: partial row/column redraw variables
155 int _redraw_toprow;
156 int _redraw_botrow;
157 int _redraw_leftcol;
158 int _redraw_rightcol;
159 Fl_Color _row_header_color;
160 Fl_Color _col_header_color;
161
162 int _auto_drag;
163 int _selecting;
164 int _scrollbar_size;
165 enum {
166 TABCELLNAV = 1<<0
167 };
168 unsigned int flags_;
169
170 Fl_Int_Vector *_colwidths; // column widths in pixels
171 Fl_Int_Vector *_rowheights; // row heights in pixels
172
173 // number of columns and rows == size of corresponding vectors
174 int col_size(); // size of the column widths vector
175 int row_size(); // size of the row heights vector
176
177 Fl_Cursor _last_cursor; // last mouse cursor before changed to 'resize' cursor
178
179 // EVENT CALLBACK DATA
180 TableContext _callback_context; // event context
181 int _callback_row, _callback_col; // event row/col
182
183 // handle() state variables.
184 // Put here instead of local statics in handle(), so more
185 // than one Fl_Table can exist without crosstalk between them.
186 //
187 int _resizing_col; // column being dragged
188 int _resizing_row; // row being dragged
189 int _dragging_x; // starting x position for horiz drag
190 int _dragging_y; // starting y position for vert drag
191 int _last_row; // last row we FL_PUSH'ed
192
193 // Redraw single cell
194 void _redraw_cell(TableContext context, int R, int C);
195
196 void _start_auto_drag();
197 void _stop_auto_drag();
198 void _auto_drag_cb();
199 static void _auto_drag_cb2(void *d);
200
201 protected:
202 enum ResizeFlag {
203 RESIZE_NONE = 0,
204 RESIZE_COL_LEFT = 1,
205 RESIZE_COL_RIGHT = 2,
206 RESIZE_ROW_ABOVE = 3,
207 RESIZE_ROW_BELOW = 4
208 };
209
210 int table_w;
211 int table_h;
212 int toprow;
213 int botrow;
214 int leftcol;
215 int rightcol;
216
217 // selection
218 int current_row;
219 int current_col;
220 int select_row;
221 int select_col;
222
223 // OPTIMIZATION: Precomputed scroll positions for the toprow/leftcol
224 int toprow_scrollpos;
225 int leftcol_scrollpos;
226
227 // Data table's inner dimension
228 int tix;
229 int tiy;
230 int tiw;
231 int tih;
232
233 // Data table's outer dimension
234 int tox;
235 int toy;
236 int tow;
237 int toh;
238
239 // Table widget's inner dimension
240 int wix;
241 int wiy;
242 int wiw;
243 int wih;
244
245 Fl_Scroll *table;
246 Fl_Scrollbar *vscrollbar;
247 Fl_Scrollbar *hscrollbar;
248
249 // Fltk
250 int handle(int e) FL_OVERRIDE; // fltk handle() FL_OVERRIDE
251
252 // Class maintenance
253 void recalc_dimensions();
254 void table_resized(); // table resized; recalc
255 void table_scrolled(); // table scrolled; recalc
256 void get_bounds(TableContext context, // return x/y/w/h bounds for context
257 int &X, int &Y, int &W, int &H);
258 void change_cursor(Fl_Cursor newcursor); // change mouse cursor to some other shape
259 TableContext cursor2rowcol(int &R, int &C, ResizeFlag &resizeflag);
260 int find_cell(TableContext context, // find cell's x/y/w/h given r/c
261 int R, int C, int &X, int &Y, int &W, int &H);
262 int row_col_clamp(TableContext context, int &R, int &C);
263 // clamp r/c to known universe
264
375 virtual void draw_cell(TableContext context, int R=0, int C=0,
376 int X=0, int Y=0, int W=0, int H=0)
377 { (void)context; (void)R; (void)C; (void)X; (void)Y; (void)W; (void)H;} // overridden by deriving class
378
379 long row_scroll_position(int row); // find scroll position of row (in pixels)
380 long col_scroll_position(int col); // find scroll position of col (in pixels)
381
385 int is_fltk_container() { // does table contain fltk widgets?
386 return( Fl_Group::children() > 3 ); // (ie. more than box and 2 scrollbars?)
387 }
388
389 static void scroll_cb(Fl_Widget*,void*); // h/v scrollbar callback
390
391 void damage_zone(int r1, int c1, int r2, int c2, int r3 = 0, int c3 = 0);
392
397 void redraw_range(int topRow, int botRow, int leftCol, int rightCol) {
398 if ( _redraw_toprow == -1 ) {
399 // Initialize redraw range
400 _redraw_toprow = topRow;
401 _redraw_botrow = botRow;
402 _redraw_leftcol = leftCol;
403 _redraw_rightcol = rightCol;
404 } else {
405 // Extend redraw range
406 if ( topRow < _redraw_toprow ) _redraw_toprow = topRow;
407 if ( botRow > _redraw_botrow ) _redraw_botrow = botRow;
408 if ( leftCol < _redraw_leftcol ) _redraw_leftcol = leftCol;
409 if ( rightCol > _redraw_rightcol ) _redraw_rightcol = rightCol;
410 }
411 // Indicate partial redraw needed of some cells
412 damage(FL_DAMAGE_CHILD);
413 }
414
415 // draw() has to be protected per FLTK convention (was public in 1.3.x)
416 void draw() FL_OVERRIDE;
417
418public:
419 Fl_Table(int X, int Y, int W, int H, const char *l=0);
420 ~Fl_Table();
421
427 virtual void clear() {
428 rows(0);
429 cols(0);
430 table->clear();
431 }
432
433 // \todo: add topline(), middleline(), bottomline()
434
440 inline void table_box(Fl_Boxtype val) {
441 table->box(val);
442 table_resized();
443 }
444
448 inline Fl_Boxtype table_box( void ) {
449 return(table->box());
450 }
451
452 virtual void rows(int val); // set number of rows
453
457 inline int rows() {
458 return(_rows);
459 }
460
461 virtual void cols(int val); // set number of columns
462
466 inline int cols() {
467 return(_cols);
468 }
469
498 inline void visible_cells(int& r1, int& r2, int& c1, int& c2) {
499 r1 = toprow;
500 r2 = botrow;
501 c1 = leftcol;
502 c2 = rightcol;
503 }
504
509 int is_interactive_resize() {
510 return(_resizing_row != -1 || _resizing_col != -1);
511 }
512
516 inline int row_resize() {
517 return(_row_resize);
518 }
519
526 void row_resize(int flag) { // enable row resizing
527 _row_resize = flag;
528 }
529
533 inline int col_resize() {
534 return(_col_resize);
535 }
536
543 void col_resize(int flag) { // enable col resizing
544 _col_resize = flag;
545 }
546
550 inline int col_resize_min() { // column minimum resizing width
551 return(_col_resize_min);
552 }
553
559 void col_resize_min(int val) {
560 _col_resize_min = ( val < 1 ) ? 1 : val;
561 }
562
566 inline int row_resize_min() { // column minimum resizing width
567 return(_row_resize_min);
568 }
569
575 void row_resize_min(int val) {
576 _row_resize_min = ( val < 1 ) ? 1 : val;
577 }
578
582 inline int row_header() { // set/get row header enable flag
583 return(_row_header);
584 }
585
590 void row_header(int flag) {
591 _row_header = flag;
592 table_resized();
593 redraw();
594 }
595
599 inline int col_header() { // set/get col header enable flag
600 return(_col_header);
601 }
602
607 void col_header(int flag) {
608 _col_header = flag;
609 table_resized();
610 redraw();
611 }
612
616 inline void col_header_height(int height) { // set/get col header height
617 _col_header_h = height;
618 table_resized();
619 redraw();
620 }
621
625 inline int col_header_height() {
626 return(_col_header_h);
627 }
628
632 inline void row_header_width(int width) { // set/get row header width
633 _row_header_w = width;
634 table_resized();
635 redraw();
636 }
637
641 inline int row_header_width() {
642 return(_row_header_w);
643 }
644
648 inline void row_header_color(Fl_Color val) { // set/get row header color
649 _row_header_color = val;
650 redraw();
651 }
652
656 inline Fl_Color row_header_color() {
657 return(_row_header_color);
658 }
659
663 inline void col_header_color(Fl_Color val) { // set/get col header color
664 _col_header_color = val;
665 redraw();
666 }
667
671 inline Fl_Color col_header_color() {
672 return(_col_header_color);
673 }
674
675 void row_height(int row, int height); // set row height in pixels
676
677 // Returns the current height of the specified row as a value in pixels.
678 int row_height(int row);
679
680 void col_width(int col, int width); // set a column's width in pixels
681
682 // Returns the current width of the specified column in pixels.
683 int col_width(int col);
684
689 void row_height_all(int height) { // set all row/col heights
690 for ( int r=0; r<rows(); r++ ) {
691 row_height(r, height);
692 }
693 }
694
699 void col_width_all(int width) {
700 for ( int c=0; c<cols(); c++ ) {
701 col_width(c, width);
702 }
703 }
704
705 void row_position(int row); // set/get table's current scroll position
706 void col_position(int col);
707
711 int row_position() {
712 return(_row_position);
713 }
714
718 int col_position() {
719 return(_col_position);
720 }
721
727 inline void top_row(int row) { // set/get top row (deprecated)
728 row_position(row);
729 }
730
735 inline int top_row() {
736 return(row_position());
737 }
738 int is_selected(int r, int c); // selected cell
739 void get_selection(int &row_top, int &col_left, int &row_bot, int &col_right);
740 void set_selection(int row_top, int col_left, int row_bot, int col_right);
741 int move_cursor(int R, int C, int shiftselect);
742 int move_cursor(int R, int C);
743 void resize(int X, int Y, int W, int H) FL_OVERRIDE; // fltk resize() FL_OVERRIDE
744
745 // This crashes sortapp() during init.
746 // void box(Fl_Boxtype val) {
747 // Fl_Group::box(val);
748 // if ( table ) {
749 // resize(x(), y(), w(), h());
750 // }
751 // }
752 // Fl_Boxtype box(void) const {
753 // return(Fl_Group::box());
754 // }
755
756 // Child group management
757
762 void init_sizes() {
763 table->init_sizes();
764 table->redraw();
765 }
766
771 void add(Fl_Widget& wgt) {
772 table->add(wgt);
773 if ( table->children() > 2 ) {
774 table->show();
775 } else {
776 table->hide();
777 }
778 }
779
784 void add(Fl_Widget* wgt) {
785 add(*wgt);
786 }
787
792 void insert(Fl_Widget& wgt, int n) {
793 table->insert(wgt,n);
794 }
795
801 void insert(Fl_Widget& wgt, Fl_Widget* w2) {
802 table->insert(wgt,w2);
803 }
804
808 void remove(Fl_Widget& wgt) {
809 table->remove(wgt);
810 }
811
812 // (doxygen will substitute Fl_Group's docs here)
813 void begin() {
814 table->begin();
815 }
816
817 // (doxygen will substitute Fl_Group's docs here)
818 void end() {
819 table->end();
820 // HACK: Avoid showing Fl_Scroll; seems to erase screen
821 // causing unnecessary flicker, even if its box() is FL_NO_BOX.
822 //
823 if ( table->children() > 2 ) {
824 table->show();
825 } else {
826 table->hide();
827 }
828 Fl_Group::current(Fl_Group::parent());
829 }
830
835 Fl_Widget*const* array() {
836 return(table->array());
837 }
838
853 Fl_Widget *child(int n) const {
854 return(table->child(n));
855 }
856
865 int children() const {
866 return(table->children()-2); // -2: skip Fl_Scroll's h/v scrollbar widgets
867 }
868
869 // (doxygen will substitute Fl_Group's docs here)
870 int find(const Fl_Widget *wgt) const {
871 return(table->find(wgt));
872 }
873
874 // (doxygen will substitute Fl_Group's docs here)
875 int find(const Fl_Widget &wgt) const {
876 return(table->find(wgt));
877 }
878
879 // CALLBACKS
880
886 int callback_row() {
887 return(_callback_row);
888 }
889
895 int callback_col() {
896 return(_callback_col);
897 }
898
904 TableContext callback_context() {
905 return(_callback_context);
906 }
907
915 void do_callback(TableContext context, int row, int col) {
916 _callback_context = context;
917 _callback_row = row;
918 _callback_col = col;
919 Fl_Widget::do_callback();
920 }
921
922#ifdef FL_DOXYGEN
951 void when(Fl_When flags);
952#endif
953
954#ifdef FL_DOXYGEN
1032 void callback(Fl_Widget*, void*);
1033#endif
1034
1044 int scrollbar_size() const {
1045 return(_scrollbar_size);
1046 }
1047
1066 void scrollbar_size(int newSize) {
1067 if ( newSize != _scrollbar_size ) redraw();
1068 _scrollbar_size = newSize;
1069 }
1070
1084 void tab_cell_nav(int val) {
1085 if ( val ) flags_ |= TABCELLNAV;
1086 else flags_ &= ~TABCELLNAV;
1087 }
1088
1096 int tab_cell_nav() const {
1097 return(flags_ & TABCELLNAV ? 1 : 0);
1098 }
1099};
1100
1101#endif /*_FL_TABLE_H*/
Fl_Cursor
Fl_Cursor
The following constants define the mouse cursors that are available in FLTK.
Definition Enumerations.H:1283
Fl_Color
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition Enumerations.H:1120
FL_DAMAGE_CHILD
@ FL_DAMAGE_CHILD
A child needs to be redrawn.
Definition Enumerations.H:1341
Fl_When
Fl_When
These constants determine when a callback is performed.
Definition Enumerations.H:435
Fl_Boxtype
Fl_Boxtype
FLTK standard box types.
Definition Enumerations.H:644
Fl_Group.H
Fl_Group and Fl_End classes.
Fl_Group::end
void end()
Exactly the same as current(this->parent()).
Definition Fl_Group.cxx:73
Fl_Group::handle
int handle(int) FL_OVERRIDE
Handles the specified event.
Definition Fl_Group.cxx:145
Fl_Group::resize
void resize(int, int, int, int) FL_OVERRIDE
Resizes the Fl_Group widget and all of its children.
Definition Fl_Group.cxx:825
Fl_Group::add
void add(Fl_Widget &)
The widget is removed from its current group (if any) and then added to the end of this group.
Definition Fl_Group.cxx:560
Fl_Group::draw
void draw() FL_OVERRIDE
Draws the widget.
Definition Fl_Group.cxx:943
Fl_Group::children
int children() const
Returns how many child widgets the group has.
Definition Fl_Group.H:98
Fl_Group::begin
void begin()
Sets the current group so you can build the widget tree by just constructing the widgets.
Definition Fl_Group.cxx:67
Fl_Group::find
int find(const Fl_Widget *) const
Searches the child array for the widget and returns the index.
Definition Fl_Group.cxx:50
Fl_Group::current
static Fl_Group * current()
Returns the currently active group.
Definition Fl_Group.cxx:82
Fl_Scroll
This container widget lets you maneuver around a set of widgets much larger than your window.
Definition Fl_Scroll.H:98
Fl_Scrollbar
The Fl_Scrollbar widget displays a slider with arrow buttons at the ends of the scrollbar.
Definition Fl_Scrollbar.H:41
Fl_Table
A table of widgets or other content.
Definition Fl_Table.H:121
Fl_Table::col_resize_min
void col_resize_min(int val)
Sets the current column minimum resize value.
Definition Fl_Table.H:559
Fl_Table::change_cursor
void change_cursor(Fl_Cursor newcursor)
Change mouse cursor to different type.
Definition Fl_Table.cxx:737
Fl_Table::row_height
void row_height(int row, int height)
Sets the height of the specified row in pixels, and the table is redrawn.
Definition Fl_Table.cxx:232
Fl_Table::is_interactive_resize
int is_interactive_resize()
Returns 1 if someone is interactively resizing a row or column.
Definition Fl_Table.H:509
Fl_Table::array
Fl_Widget *const * array()
Returns a pointer to the array of children.
Definition Fl_Table.H:835
Fl_Table::toy
int toy
Data table's outer y dimension, outside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:235
Fl_Table::remove
void remove(Fl_Widget &wgt)
The specified widget is removed from Fl_Table's group.
Definition Fl_Table.H:808
Fl_Table::cursor2rowcol
TableContext cursor2rowcol(int &R, int &C, ResizeFlag &resizeflag)
Find row/col for the recent mouse event.
Definition Fl_Table.cxx:361
Fl_Table::wiw
int wiw
Table widget's inner w dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:242
Fl_Table::table
Fl_Scroll * table
child Fl_Scroll widget container for child fltk widgets (if any)
Definition Fl_Table.H:245
Fl_Table::toh
int toh
Data table's outer h dimension, outside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:237
Fl_Table::col_width_all
void col_width_all(int width)
Convenience method to set the width of all columns to the same value, in pixels.
Definition Fl_Table.H:699
Fl_Table::row_resize_min
void row_resize_min(int val)
Sets the current row minimum resize value.
Definition Fl_Table.H:575
Fl_Table::table_resized
void table_resized()
Call this if table was resized, to recalculate internal data.
Definition Fl_Table.cxx:633
Fl_Table::get_bounds
void get_bounds(TableContext context, int &X, int &Y, int &W, int &H)
Returns the (X,Y,W,H) bounding region for the specified 'context'.
Definition Fl_Table.cxx:325
Fl_Table::row_header_width
void row_header_width(int width)
Sets the row header width to n and causes the screen to redraw.
Definition Fl_Table.H:632
Fl_Table::add
void add(Fl_Widget *wgt)
The specified widget is removed from its current group (if any) and added to the end of Fl_Table's gr...
Definition Fl_Table.H:784
Fl_Table::recalc_dimensions
void recalc_dimensions()
Recalculate the dimensions of the table, and affect any children.
Definition Fl_Table.cxx:551
Fl_Table::current_row
int current_row
selection cursor's current row (-1 if none)
Definition Fl_Table.H:218
Fl_Table::table_box
void table_box(Fl_Boxtype val)
Sets the kind of box drawn around the data table, the default being FL_NO_BOX.
Definition Fl_Table.H:440
Fl_Table::select_row
int select_row
extended selection row (-1 if none)
Definition Fl_Table.H:220
Fl_Table::botrow
int botrow
bottom row# of currently visible table on screen
Definition Fl_Table.H:213
Fl_Table::insert
void insert(Fl_Widget &wgt, int n)
The specified widget is removed from its current group (if any) and inserted into the Fl_Table's grou...
Definition Fl_Table.H:792
Fl_Table::draw_cell
virtual void draw_cell(TableContext context, int R=0, int C=0, int X=0, int Y=0, int W=0, int H=0)
Subclass should override this method to handle drawing the cells.
Definition Fl_Table.H:375
Fl_Table::row_resize_min
int row_resize_min()
Returns the current row minimum resize value.
Definition Fl_Table.H:566
Fl_Table::rightcol
int rightcol
right column# of currently visible table on screen
Definition Fl_Table.H:215
Fl_Table::row_header
void row_header(int flag)
Enables/disables showing the row headers.
Definition Fl_Table.H:590
Fl_Table::clear
virtual void clear()
Clears the table to zero rows (rows(0)), zero columns (cols(0)), and clears any widgets (table->clear...
Definition Fl_Table.H:427
Fl_Table::wih
int wih
Table widget's inner h dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:243
Fl_Table::tab_cell_nav
void tab_cell_nav(int val)
Flag to control if Tab navigates table cells or not.
Definition Fl_Table.H:1084
Fl_Table::tiw
int tiw
Data table's inner w dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:230
Fl_Table::tiy
int tiy
Data table's inner y dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:229
Fl_Table::row_height_all
void row_height_all(int height)
Convenience method to set the height of all rows to the same value, in pixels.
Definition Fl_Table.H:689
Fl_Table::tow
int tow
Data table's outer w dimension, outside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:236
Fl_Table::tih
int tih
Data table's inner h dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:231
Fl_Table::wiy
int wiy
Table widget's inner y dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:241
Fl_Table::callback_col
int callback_col()
Returns the current column the event occurred on.
Definition Fl_Table.H:895
Fl_Table::leftcol
int leftcol
left column# of currently visible table on screen
Definition Fl_Table.H:214
Fl_Table::row_header_color
void row_header_color(Fl_Color val)
Sets the row header color and causes the screen to redraw.
Definition Fl_Table.H:648
Fl_Table::children
int children() const
Returns the number of children in the table.
Definition Fl_Table.H:865
Fl_Table::callback_row
int callback_row()
Returns the current row the event occurred on.
Definition Fl_Table.H:886
Fl_Table::row_header_width
int row_header_width()
Returns the current row header width (in pixels).
Definition Fl_Table.H:641
Fl_Table::callback_context
TableContext callback_context()
Returns the current 'table context'.
Definition Fl_Table.H:904
Fl_Table::init_sizes
void init_sizes()
Resets the internal array of widget sizes and positions.
Definition Fl_Table.H:762
Fl_Table::do_callback
void do_callback(TableContext context, int row, int col)
Calls the widget callback.
Definition Fl_Table.H:915
Fl_Table::col_header_height
int col_header_height()
Gets the column header height.
Definition Fl_Table.H:625
Fl_Table::wix
int wix
Table widget's inner x dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:240
Fl_Table::TableContext
TableContext
The context bit flags for Fl_Table related callbacks.
Definition Fl_Table.H:129
Fl_Table::CONTEXT_COL_HEADER
@ CONTEXT_COL_HEADER
drawing or event occurred in the col header
Definition Fl_Table.H:134
Fl_Table::CONTEXT_TABLE
@ CONTEXT_TABLE
drawing or event occurred in a dead zone of table
Definition Fl_Table.H:136
Fl_Table::CONTEXT_STARTPAGE
@ CONTEXT_STARTPAGE
before the table is redrawn
Definition Fl_Table.H:131
Fl_Table::CONTEXT_RC_RESIZE
@ CONTEXT_RC_RESIZE
column or row is being resized
Definition Fl_Table.H:137
Fl_Table::CONTEXT_ROW_HEADER
@ CONTEXT_ROW_HEADER
drawing or event occurred in the row header
Definition Fl_Table.H:133
Fl_Table::CONTEXT_ENDPAGE
@ CONTEXT_ENDPAGE
after the table is redrawn
Definition Fl_Table.H:132
Fl_Table::CONTEXT_CELL
@ CONTEXT_CELL
drawing or event occurred in a cell
Definition Fl_Table.H:135
Fl_Table::CONTEXT_NONE
@ CONTEXT_NONE
no known context
Definition Fl_Table.H:130
Fl_Table::row_col_clamp
int row_col_clamp(TableContext context, int &R, int &C)
Return specified row/col values R and C to within the table's current row/col limits.
Definition Fl_Table.cxx:297
Fl_Table::col_header
int col_header()
Returns if column headers are enabled or not.
Definition Fl_Table.H:599
Fl_Table::row_header_color
Fl_Color row_header_color()
Returns the current row header color.
Definition Fl_Table.H:656
Fl_Table::cols
int cols()
Get the number of columns in the table.
Definition Fl_Table.H:466
Fl_Table::select_col
int select_col
extended selection column (-1 if none)
Definition Fl_Table.H:221
Fl_Table::Fl_Table
Fl_Table(int X, int Y, int W, int H, const char *l=0)
The constructor for Fl_Table.
Definition Fl_Table.cxx:119
Fl_Table::col_width
void col_width(int col, int width)
Sets the width of the specified column in pixels, and the table is redrawn.
Definition Fl_Table.cxx:264
Fl_Table::visible_cells
void visible_cells(int &r1, int &r2, int &c1, int &c2)
Returns the range of row and column numbers for all visible and partially visible cells in the table.
Definition Fl_Table.H:498
Fl_Table::insert
void insert(Fl_Widget &wgt, Fl_Widget *w2)
The specified widget is removed from its current group (if any) and inserted into Fl_Table's group be...
Definition Fl_Table.H:801
Fl_Table::tab_cell_nav
int tab_cell_nav() const
Get state of table's 'Tab' key cell navigation flag.
Definition Fl_Table.H:1096
Fl_Table::top_row
void top_row(int row)
Sets which row should be at the top of the table, scrolling as necessary, and the table is redrawn.
Definition Fl_Table.H:727
Fl_Table::rows
virtual void rows(int val)
Sets the number of rows in the table, and the table is redrawn.
Definition Fl_Table.cxx:686
Fl_Table::table_w
int table_w
table's virtual width (in pixels)
Definition Fl_Table.H:210
Fl_Table::cols
virtual void cols(int val)
Set the number of columns in the table and redraw.
Definition Fl_Table.cxx:715
Fl_Table::toprow_scrollpos
int toprow_scrollpos
precomputed scroll position for top row
Definition Fl_Table.H:224
Fl_Table::col_resize
int col_resize()
Returns if column resizing by the user is allowed.
Definition Fl_Table.H:533
Fl_Table::table_box
Fl_Boxtype table_box(void)
Returns the current box type used for the data table.
Definition Fl_Table.H:448
Fl_Table::current_col
int current_col
selection cursor's current column (-1 if none)
Definition Fl_Table.H:219
Fl_Table::col_header_height
void col_header_height(int height)
Sets the height in pixels for column headers and redraws the table.
Definition Fl_Table.H:616
Fl_Table::row_position
int row_position()
Returns the current row scroll position as a row number.
Definition Fl_Table.H:711
Fl_Table::row_resize
void row_resize(int flag)
Allows/disallows row resizing by the user.
Definition Fl_Table.H:526
Fl_Table::tox
int tox
Data table's outer x dimension, outside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:234
Fl_Table::vscrollbar
Fl_Scrollbar * vscrollbar
child vertical scrollbar widget
Definition Fl_Table.H:246
Fl_Table::child
Fl_Widget * child(int n) const
Returns the child widget by an index.
Definition Fl_Table.H:853
Fl_Table::col_header
void col_header(int flag)
Enable or disable column headers.
Definition Fl_Table.H:607
Fl_Table::scrollbar_size
int scrollbar_size() const
Gets the current size of the scrollbars' troughs, in pixels.
Definition Fl_Table.H:1044
Fl_Table::leftcol_scrollpos
int leftcol_scrollpos
precomputed scroll position for left column
Definition Fl_Table.H:225
Fl_Table::top_row
int top_row()
Returns the current top row shown in the table.
Definition Fl_Table.H:735
Fl_Table::col_header_color
Fl_Color col_header_color()
Gets the color for column headers.
Definition Fl_Table.H:671
Fl_Table::table_scrolled
void table_scrolled()
Recalculate internals after a scroll.
Definition Fl_Table.cxx:592
Fl_Table::col_resize_min
int col_resize_min()
Returns the current column minimum resize value.
Definition Fl_Table.H:550
Fl_Table::row_header
int row_header()
Returns if row headers are enabled or not.
Definition Fl_Table.H:582
Fl_Table::when
void when(Fl_When flags)
The Fl_Widget::when() function is used to set a group of flags, determining when the widget callback ...
Fl_Table::row_position
void row_position(int row)
Sets the vertical scroll position so 'row' is at the top, and causes the screen to redraw.
Definition Fl_Table.cxx:42
Fl_Table::add
void add(Fl_Widget &wgt)
The specified widget is removed from its current group (if any) and added to the end of Fl_Table's gr...
Definition Fl_Table.H:771
Fl_Table::find_cell
int find_cell(TableContext context, int R, int C, int &X, int &Y, int &W, int &H)
Find a cell's X/Y/W/H region for the specified cell in row 'R', column 'C'.
Definition Fl_Table.cxx:443
Fl_Table::col_header_color
void col_header_color(Fl_Color val)
Sets the color for column headers and redraws the table.
Definition Fl_Table.H:663
Fl_Table::is_fltk_container
int is_fltk_container()
Does the table contain any child fltk widgets?
Definition Fl_Table.H:385
Fl_Table::tix
int tix
Data table's inner x dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:228
Fl_Table::col_position
int col_position()
Returns the current column scroll position as a column number.
Definition Fl_Table.H:718
Fl_Table::hscrollbar
Fl_Scrollbar * hscrollbar
child horizontal scrollbar widget
Definition Fl_Table.H:247
Fl_Table::scrollbar_size
void scrollbar_size(int newSize)
Sets the pixel size of the scrollbars' troughs to newSize, in pixels.
Definition Fl_Table.H:1066
Fl_Table::row_resize
int row_resize()
Returns if row resizing by the user is allowed.
Definition Fl_Table.H:516
Fl_Table::toprow
int toprow
top row# of currently visible table on screen
Definition Fl_Table.H:212
Fl_Table::col_resize
void col_resize(int flag)
Allows/disallows column resizing by the user.
Definition Fl_Table.H:543
Fl_Table::rows
int rows()
Returns the number of rows in the table.
Definition Fl_Table.H:457
Fl_Table::table_h
int table_h
table's virtual height (in pixels)
Definition Fl_Table.H:211
Fl_Table::callback
void callback(Fl_Widget *, void *)
Callbacks will be called depending on the setting of Fl_Widget::when().
Fl_Table::redraw_range
void redraw_range(int topRow, int botRow, int leftCol, int rightCol)
Define region of cells to be redrawn by specified range of rows/cols, and then sets damage(DAMAGE_CHI...
Definition Fl_Table.H:397
Fl_Widget
Fl_Widget is the base class for all widgets in FLTK.
Definition Fl_Widget.H:112
Fl_Widget::hide
virtual void hide()
Makes a widget invisible.
Definition Fl_Widget.cxx:263
Fl_Widget::flags
unsigned int flags() const
Gets the widget flags mask.
Definition Fl_Widget.H:158
Fl_Widget::redraw
void redraw()
Schedules the drawing of the widget.
Definition Fl.cxx:1668
Fl_Widget::show
virtual void show()
Makes a widget visible.
Definition Fl_Widget.cxx:251
Fl_Widget::parent
Fl_Group * parent() const
Returns a pointer to the parent widget.
Definition Fl_Widget.H:334
Fl_Widget::damage
uchar damage() const
Returns non-zero if draw() needs to be called.
Definition Fl_Widget.H:1146
Fl_Widget::do_callback
void do_callback(Fl_Callback_Reason reason=FL_REASON_UNKNOWN)
Calls the widget callback function with default arguments.
Definition Fl_Widget.H:1089
FL_OVERRIDE
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46