FLTK 1.4.0
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>
32typedef std::vector<int> Fl_Int_Vector;
33#else
34class Fl_Int_Vector; // private class declared in src/Fl_Int_Vector.H
35#endif
36
121class FL_EXPORT Fl_Table : public Fl_Group {
122public:
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
140private:
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
201protected:
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
212 int toprow;
213 int botrow;
216
217 // selection
222
223 // OPTIMIZATION: Precomputed scroll positions for the toprow/leftcol
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
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
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
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
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
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
712 return(_row_position);
713 }
714
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 }
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
887 return(_callback_row);
888 }
889
896 return(_callback_col);
897 }
898
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;
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
The following constants define the mouse cursors that are available in FLTK.
Definition Enumerations.H:1261
unsigned int Fl_Color
An FLTK color value; see also Colors
Definition Enumerations.H:1101
@ FL_DAMAGE_CHILD
A child needs to be redrawn.
Definition Enumerations.H:1319
Fl_When
These constants determine when a callback is performed.
Definition Enumerations.H:426
Fl_Boxtype
FLTK standard box types.
Definition Enumerations.H:626
Fl_Group and Fl_End classes.
The Fl_Group class is the FLTK container widget.
Definition Fl_Group.H:56
void end()
Exactly the same as current(this->parent()).
Definition Fl_Group.cxx:73
int handle(int) FL_OVERRIDE
Handles the specified event.
Definition Fl_Group.cxx:145
void resize(int, int, int, int) FL_OVERRIDE
Resizes the Fl_Group widget and all of its children.
Definition Fl_Group.cxx:823
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:558
void draw() FL_OVERRIDE
Draws the widget.
Definition Fl_Group.cxx:926
Fl_Widget * child(int n) const
Returns array()[n].
Definition Fl_Group.H:102
void insert(Fl_Widget &, int i)
The widget is removed from its current group (if any) and then inserted into this group.
Definition Fl_Group.cxx:509
int children() const
Returns how many child widgets the group has.
Definition Fl_Group.H:98
void begin()
Sets the current group so you can build the widget tree by just constructing the widgets.
Definition Fl_Group.cxx:67
Fl_Widget *const * array() const
Returns a pointer to the array of children.
Definition Fl_Group.cxx:41
int find(const Fl_Widget *) const
Searches the child array for the widget and returns the index.
Definition Fl_Group.cxx:50
void init_sizes()
Resets the internal array of widget sizes and positions.
Definition Fl_Group.cxx:690
void remove(int index)
Removes the widget at index from the group but does not delete it.
Definition Fl_Group.cxx:583
static Fl_Group * current()
Returns the currently active group.
Definition Fl_Group.cxx:82
This container widget lets you maneuver around a set of widgets much larger than your window.
Definition Fl_Scroll.H:98
void clear()
Clear all but the scrollbars...
Definition Fl_Scroll.cxx:23
The Fl_Scrollbar widget displays a slider with arrow buttons at the ends of the scrollbar.
Definition Fl_Scrollbar.H:41
A table of widgets or other content.
Definition Fl_Table.H:121
void col_resize_min(int val)
Sets the current column minimum resize value.
Definition Fl_Table.H:559
int is_interactive_resize()
Returns 1 if someone is interactively resizing a row or column.
Definition Fl_Table.H:509
Fl_Widget *const * array()
Returns a pointer to the array of children.
Definition Fl_Table.H:835
int toy
Data table's outer y dimension, outside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:235
void remove(Fl_Widget &wgt)
The specified widget is removed from Fl_Table's group.
Definition Fl_Table.H:808
int wiw
Table widget's inner w dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:242
Fl_Scroll * table
child Fl_Scroll widget container for child fltk widgets (if any)
Definition Fl_Table.H:245
int toh
Data table's outer h dimension, outside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:237
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
void row_resize_min(int val)
Sets the current row minimum resize value.
Definition Fl_Table.H:575
void row_header_width(int width)
Sets the row header width to n and causes the screen to redraw.
Definition Fl_Table.H:632
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
int current_row
selection cursor's current row (-1 if none)
Definition Fl_Table.H:218
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
int select_row
extended selection row (-1 if none)
Definition Fl_Table.H:220
int botrow
bottom row# of currently visible table on screen
Definition Fl_Table.H:213
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
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
int row_resize_min()
Returns the current row minimum resize value.
Definition Fl_Table.H:566
int rightcol
right column# of currently visible table on screen
Definition Fl_Table.H:215
void row_header(int flag)
Enables/disables showing the row headers.
Definition Fl_Table.H:590
int wih
Table widget's inner h dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:243
void tab_cell_nav(int val)
Flag to control if Tab navigates table cells or not.
Definition Fl_Table.H:1084
int tiw
Data table's inner w dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:230
int tiy
Data table's inner y dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:229
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
int tow
Data table's outer w dimension, outside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:236
int tih
Data table's inner h dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:231
int wiy
Table widget's inner y dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:241
int callback_col()
Returns the current column the event occurred on.
Definition Fl_Table.H:895
int leftcol
left column# of currently visible table on screen
Definition Fl_Table.H:214
void row_header_color(Fl_Color val)
Sets the row header color and causes the screen to redraw.
Definition Fl_Table.H:648
int children() const
Returns the number of children in the table.
Definition Fl_Table.H:865
int callback_row()
Returns the current row the event occurred on.
Definition Fl_Table.H:886
int row_header_width()
Returns the current row header width (in pixels).
Definition Fl_Table.H:641
TableContext callback_context()
Returns the current 'table context'.
Definition Fl_Table.H:904
void init_sizes()
Resets the internal array of widget sizes and positions.
Definition Fl_Table.H:762
void do_callback(TableContext context, int row, int col)
Calls the widget callback.
Definition Fl_Table.H:915
int col_header_height()
Gets the column header height.
Definition Fl_Table.H:625
int wix
Table widget's inner x dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:240
TableContext
The context bit flags for Fl_Table related callbacks.
Definition Fl_Table.H:129
int col_header()
Returns if column headers are enabled or not.
Definition Fl_Table.H:599
Fl_Color row_header_color()
Returns the current row header color.
Definition Fl_Table.H:656
int cols()
Get the number of columns in the table.
Definition Fl_Table.H:466
int select_col
extended selection column (-1 if none)
Definition Fl_Table.H:221
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
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
int tab_cell_nav() const
Get state of table's 'Tab' key cell navigation flag.
Definition Fl_Table.H:1096
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
int table_w
table's virtual width (in pixels)
Definition Fl_Table.H:210
int toprow_scrollpos
precomputed scroll position for top row
Definition Fl_Table.H:224
int col_resize()
Returns if column resizing by the user is allowed.
Definition Fl_Table.H:533
Fl_Boxtype table_box(void)
Returns the current box type used for the data table.
Definition Fl_Table.H:448
int current_col
selection cursor's current column (-1 if none)
Definition Fl_Table.H:219
void col_header_height(int height)
Sets the height in pixels for column headers and redraws the table.
Definition Fl_Table.H:616
int row_position()
Returns the current row scroll position as a row number.
Definition Fl_Table.H:711
void row_resize(int flag)
Allows/disallows row resizing by the user.
Definition Fl_Table.H:526
int tox
Data table's outer x dimension, outside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:234
Fl_Scrollbar * vscrollbar
child vertical scrollbar widget
Definition Fl_Table.H:246
Fl_Widget * child(int n) const
Returns the child widget by an index.
Definition Fl_Table.H:853
void col_header(int flag)
Enable or disable column headers.
Definition Fl_Table.H:607
int scrollbar_size() const
Gets the current size of the scrollbars' troughs, in pixels.
Definition Fl_Table.H:1044
int leftcol_scrollpos
precomputed scroll position for left column
Definition Fl_Table.H:225
int top_row()
Returns the current top row shown in the table.
Definition Fl_Table.H:735
Fl_Color col_header_color()
Gets the color for column headers.
Definition Fl_Table.H:671
int col_resize_min()
Returns the current column minimum resize value.
Definition Fl_Table.H:550
int row_header()
Returns if row headers are enabled or not.
Definition Fl_Table.H:582
void when(Fl_When flags)
The Fl_Widget::when() function is used to set a group of flags, determining when the widget callback ...
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
void col_header_color(Fl_Color val)
Sets the color for column headers and redraws the table.
Definition Fl_Table.H:663
int is_fltk_container()
Does the table contain any child fltk widgets?
Definition Fl_Table.H:385
int tix
Data table's inner x dimension, inside bounding box. See Table Dimension Diagram.
Definition Fl_Table.H:228
int col_position()
Returns the current column scroll position as a column number.
Definition Fl_Table.H:718
Fl_Scrollbar * hscrollbar
child horizontal scrollbar widget
Definition Fl_Table.H:247
void scrollbar_size(int newSize)
Sets the pixel size of the scrollbars' troughs to newSize, in pixels.
Definition Fl_Table.H:1066
int row_resize()
Returns if row resizing by the user is allowed.
Definition Fl_Table.H:516
int toprow
top row# of currently visible table on screen
Definition Fl_Table.H:212
void col_resize(int flag)
Allows/disallows column resizing by the user.
Definition Fl_Table.H:543
int rows()
Returns the number of rows in the table.
Definition Fl_Table.H:457
int table_h
table's virtual height (in pixels)
Definition Fl_Table.H:211
void callback(Fl_Widget *, void *)
Callbacks will be called depending on the setting of Fl_Widget::when().
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 is the base class for all widgets in FLTK.
Definition Fl_Widget.H:104
virtual void hide()
Makes a widget invisible.
Definition Fl_Widget.cxx:279
Fl_Boxtype box() const
Gets the box type of the widget.
Definition Fl_Widget.H:432
void redraw()
Schedules the drawing of the widget.
Definition Fl.cxx:1586
virtual void show()
Makes a widget visible.
Definition Fl_Widget.cxx:267
Fl_Group * parent() const
Returns a pointer to the parent widget.
Definition Fl_Widget.H:326
uchar damage() const
Returns non-zero if draw() needs to be called.
Definition Fl_Widget.H:1107
void do_callback(Fl_Callback_Reason reason=FL_REASON_UNKNOWN)
Calls the widget callback function with default arguments.
Definition Fl_Widget.H:1050
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46