32#include <FL/Fl_Group.H> 
   33#include <FL/Fl_Scroll.H> 
   35#include <FL/Fl_Scrollbar.H> 
  206  int _redraw_rightcol;
 
  212#if FLTK_ABI_VERSION >= 10301 
  215#if FLTK_ABI_VERSION >= 10303 
  223  class FL_EXPORT IntVector {
 
  230    void copy(
int *newarr, 
unsigned int newsize) {
 
  232      memcpy(arr, newarr, newsize * 
sizeof(
int));
 
  235    IntVector() { init(); }                                     
 
  236    ~IntVector() { 
if ( arr ) free(arr); arr = NULL; }          
 
  237    IntVector(IntVector&o) { init(); copy(o.arr, o._size); }    
 
  238    IntVector& operator=(IntVector&o) {                         
 
  240      copy(o.arr, o._size);
 
  243    int operator[](
int x)
 const { 
return(arr[x]); }
 
  244    int& operator[](
int x) { 
return(arr[x]); }
 
  245    unsigned int size() { 
return(_size); }
 
  246    void size(
unsigned int count) {
 
  247      if ( count != _size ) {
 
  248        arr = (
int*)realloc(arr, count * 
sizeof(
int));
 
  252    int pop_back() { 
int tmp = arr[_size-1]; _size--; 
return(tmp); }
 
  253    void push_back(
int val) { 
unsigned int x = _size; 
size(_size+1); arr[x] = val; }
 
  254    int back() { 
return(arr[_size-1]); }
 
  257  IntVector _colwidths;                 
 
  258  IntVector _rowheights;                
 
  263  TableContext _callback_context;       
 
  264  int _callback_row, _callback_col;     
 
  277  void _redraw_cell(TableContext context, 
int R, 
int C);
 
  279  void _start_auto_drag();
 
  280  void _stop_auto_drag();
 
  281  void _auto_drag_cb();
 
  282  static void _auto_drag_cb2(
void *d);
 
  288    RESIZE_COL_RIGHT = 2,
 
  289    RESIZE_ROW_ABOVE = 3,
 
  293  int table_w, table_h;                         
 
  294  int toprow, botrow, leftcol, rightcol;        
 
  297  int current_row, current_col;
 
  298  int select_row, select_col;
 
  301  int toprow_scrollpos;
 
  302  int leftcol_scrollpos;
 
  305  int tix, tiy, tiw, tih;                       
 
  306  int tox, toy, tow, toh;                       
 
  307  int wix, wiy, wiw, wih;                       
 
  310  Fl_Scrollbar *vscrollbar;                     
 
  311  Fl_Scrollbar *hscrollbar;                     
 
  317  void recalc_dimensions();
 
  318  void table_resized();                         
 
  319  void table_scrolled();                        
 
  320  void get_bounds(TableContext context,         
 
  321                  int &X, 
int &Y, 
int &W, 
int &H);
 
  323  TableContext cursor2rowcol(
int &R, 
int &C, ResizeFlag &resizeflag);
 
  325  int find_cell(TableContext context,           
 
  326                int R, 
int C, 
int &X, 
int &Y, 
int &W, 
int &H);
 
  327  int row_col_clamp(TableContext context, 
int &R, 
int &C);
 
  441                         int X=0, 
int Y=0, 
int W=0, 
int H=0)
 
 
  444  long row_scroll_position(
int row);            
 
  445  long col_scroll_position(
int col);            
 
  447  int is_fltk_container() {                     
 
  451  static void scroll_cb(Fl_Widget*,
void*);      
 
  453  void damage_zone(
int r1, 
int c1, 
int r2, 
int c2, 
int r3 = 0, 
int c3 = 0);
 
  455  void redraw_range(
int topRow, 
int botRow, 
int leftCol, 
int rightCol) {
 
  456    if ( _redraw_toprow == -1 ) {
 
  458      _redraw_toprow = topRow;
 
  459      _redraw_botrow = botRow;
 
  460      _redraw_leftcol = leftCol;
 
  461      _redraw_rightcol = rightCol;
 
  464      if ( topRow < _redraw_toprow ) _redraw_toprow = topRow;
 
  465      if ( botRow > _redraw_botrow ) _redraw_botrow = botRow;
 
  466      if ( leftCol < _redraw_leftcol ) _redraw_leftcol = leftCol;
 
  467      if ( rightCol > _redraw_rightcol ) _redraw_rightcol = rightCol;
 
  480  Fl_Table(
int X, 
int Y, 
int W, 
int H, 
const char *l=0);
 
  511    return(table->box());
 
 
  517  virtual void rows(
int val);                   
 
  529  virtual void cols(
int val);                   
 
  578    return(_resizing_row != -1 || _resizing_col != -1);
 
 
  618    return(_col_resize_min);
 
 
  627    _col_resize_min = ( val < 1 ) ? 1 : val;
 
 
  634    return(_row_resize_min);
 
 
  643    _row_resize_min = ( val < 1 ) ? 1 : val;
 
 
  684    _col_header_h = height;
 
 
  693    return(_col_header_h);
 
 
  700    _row_header_w = width;
 
 
  709    return(_row_header_w);
 
 
  716    _row_header_color = val;
 
 
  724    return(_row_header_color);
 
 
  731    _col_header_color = val;
 
 
  739    return(_col_header_color);
 
 
  748  void row_height(
int row, 
int height);         
 
  754    return((row<0 || row>=(
int)_rowheights.size()) ? 0 : _rowheights[row]);
 
 
  762  void col_width(
int col, 
int width);           
 
  768    return((col<0 || col>=(
int)_colwidths.size()) ? 0 : _colwidths[col]);
 
 
  776    for ( 
int r=0; r<
rows(); r++ ) {
 
 
  786    for ( 
int c=0; c<
cols(); c++ ) {
 
 
  794  void row_position(
int row);                   
 
  799  void col_position(
int col);
 
  805    return(_row_position);
 
 
  812    return(_col_position);
 
 
  831  int is_selected(
int r, 
int c);                
 
  832  void get_selection(
int &row_top, 
int &col_left, 
int &row_bot, 
int &col_right);
 
  833  void set_selection(
int row_top, 
int col_left, 
int row_bot, 
int col_right);
 
  834  int move_cursor(
int R, 
int C, 
int shiftselect);
 
  835  int move_cursor(
int R, 
int C);
 
  840  void resize(
int X, 
int Y, 
int W, 
int H);        
 
  859  void add(Fl_Widget& wgt) {
 
  867  void add(Fl_Widget* wgt) {
 
  870  void insert(Fl_Widget& wgt, 
int n) {
 
  873  void insert(Fl_Widget& wgt, Fl_Widget* w2) {
 
  876  void remove(Fl_Widget& wgt) {
 
  894  Fl_Widget * 
const *array() {
 
  895    return(table->
array());
 
  913    return(table->child(n));
 
 
  925    return(table->children()-2);    
 
 
  928    return(table->find(wgt));
 
  930  int find(
const Fl_Widget &wgt)
 const {
 
  931    return(table->
find(wgt));
 
  941    return(_callback_row);
 
 
  950    return(_callback_col);
 
 
  959    return(_callback_context);
 
 
  962  void do_callback(TableContext context, 
int row, 
int col) {
 
  963    _callback_context = context;
 
 1082#if FLTK_ABI_VERSION >= 10301 
 1094      return(_scrollbar_size);
 
 
 1115      if ( newSize != _scrollbar_size ) 
redraw();
 
 1116      _scrollbar_size = newSize;
 
 
 1119#if FLTK_ABI_VERSION >= 10303 
 1134    if ( val ) flags_ |=  TABCELLNAV;
 
 1135    else       flags_ &= ~TABCELLNAV;
 
 
 1146    return(flags_ & TABCELLNAV ? 1 : 0);
 
 
 
Fl_Cursor
The following constants define the mouse cursors that are available in FLTK.
Definition Enumerations.H:1055
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition Enumerations.H:941
@ FL_DAMAGE_CHILD
A child needs to be redrawn.
Definition Enumerations.H:1113
Fl_When
These constants determine when a callback is performed.
Definition Enumerations.H:437
Fl_Boxtype
Definition Enumerations.H:610
void end()
Exactly the same as current(this->parent()).
Definition Fl_Group.cxx:75
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:491
int handle(int)
Handles the specified event.
Definition Fl_Group.cxx:147
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:458
int children() const
Returns how many child widgets the group has.
Definition Fl_Group.H:75
void draw()
Draws the widget.
Definition Fl_Group.cxx:738
void begin()
Sets the current group so you can build the widget tree by just constructing the widgets.
Definition Fl_Group.cxx:69
void resize(int, int, int, int)
Resizes the Fl_Group widget and all of its children.
Definition Fl_Group.cxx:634
Fl_Widget *const * array() const
Returns a pointer to the array of children.
Definition Fl_Group.cxx:44
int find(const Fl_Widget *) const
Searches the child array for the widget and returns the index.
Definition Fl_Group.cxx:52
void init_sizes()
Resets the internal array of widget sizes and positions.
Definition Fl_Group.cxx:572
void remove(int index)
Removes the widget at index from the group but does not delete it.
Definition Fl_Group.cxx:503
static Fl_Group * current()
Returns the currently active group.
Definition Fl_Group.cxx:84
void col_resize_min(int val)
Sets the current column minimum resize value.
Definition Fl_Table.H:626
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:169
int is_interactive_resize()
Returns 1 if someone is interactively resizing a row or column.
Definition Fl_Table.H:577
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:785
void row_resize_min(int val)
Sets the current row minimum resize value.
Definition Fl_Table.H:642
void row_header_width(int width)
Sets the row header width to n and causes the screen to redraw.
Definition Fl_Table.H:699
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:502
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:440
int row_resize_min()
Returns the current row minimum resize value.
Definition Fl_Table.H:633
void row_header(int flag)
Enables/disables showing the row headers.
Definition Fl_Table.H:657
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:493
int row_height(int row)
Returns the current height of the specified row as a value in pixels.
Definition Fl_Table.H:753
void tab_cell_nav(int val)
Flag to control if Tab navigates table cells or not.
Definition Fl_Table.H:1133
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:775
int callback_col()
Returns the current column the event occurred on.
Definition Fl_Table.H:949
void row_header_color(Fl_Color val)
Sets the row header color and causes the screen to redraw.
Definition Fl_Table.H:715
int children() const
Returns the number of children in the table.
Definition Fl_Table.H:924
int callback_row()
Returns the current row the event occurred on.
Definition Fl_Table.H:940
int row_header_width()
Returns the current row header width (in pixels).
Definition Fl_Table.H:708
TableContext callback_context()
Returns the current 'table context'.
Definition Fl_Table.H:958
int col_header_height()
Gets the column header height.
Definition Fl_Table.H:692
TableContext
The context bit flags for Fl_Table related callbacks.
Definition Fl_Table.H:177
@ CONTEXT_COL_HEADER
in the col header
Definition Fl_Table.H:182
@ CONTEXT_TABLE
in a dead zone of table
Definition Fl_Table.H:184
@ CONTEXT_STARTPAGE
before a page is redrawn
Definition Fl_Table.H:179
@ CONTEXT_RC_RESIZE
column or row being resized
Definition Fl_Table.H:185
@ CONTEXT_ROW_HEADER
in the row header
Definition Fl_Table.H:181
@ CONTEXT_ENDPAGE
after a page is redrawn
Definition Fl_Table.H:180
@ CONTEXT_CELL
in one of the cells
Definition Fl_Table.H:183
@ CONTEXT_NONE
no known context
Definition Fl_Table.H:178
int col_header()
Returns if column headers are enabled or not.
Definition Fl_Table.H:666
Fl_Color row_header_color()
Returns the current row header color.
Definition Fl_Table.H:723
int cols()
Get the number of columns in the table.
Definition Fl_Table.H:534
Fl_Table(int X, int Y, int W, int H, const char *l=0)
The constructor for the Fl_Table.
Definition Fl_Table.cxx:95
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:193
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:566
int tab_cell_nav() const
Get state of table's 'Tab' key cell navigation flag.
Definition Fl_Table.H:1145
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:820
virtual void rows(int val)
Sets the number of rows in the table, and the table is redrawn.
Definition Fl_Table.cxx:610
virtual void cols(int val)
Set the number of columns in the table and redraw.
Definition Fl_Table.cxx:632
int col_width(int col)
Returns the current width of the specified column in pixels.
Definition Fl_Table.H:767
int col_resize()
Returns if column resizing by the user is allowed.
Definition Fl_Table.H:601
Fl_Boxtype table_box(void)
Returns the current box type used for the data table.
Definition Fl_Table.H:510
void col_header_height(int height)
Sets the height in pixels for column headers and redraws the table.
Definition Fl_Table.H:683
int row_position()
Returns the current row scroll position as a row number.
Definition Fl_Table.H:804
void row_resize(int flag)
Allows/disallows row resizing by the user.
Definition Fl_Table.H:594
Fl_Widget * child(int n) const
Returns the child widget by an index.
Definition Fl_Table.H:912
void col_header(int flag)
Enable or disable column headers.
Definition Fl_Table.H:674
int scrollbar_size() const
Gets the current size of the scrollbars' troughs, in pixels.
Definition Fl_Table.H:1093
int top_row()
Returns the current top row shown in the table.
Definition Fl_Table.H:828
Fl_Color col_header_color()
Gets the color for column headers.
Definition Fl_Table.H:738
int col_resize_min()
Returns the current column minimum resize value.
Definition Fl_Table.H:617
int row_header()
Returns if row headers are enabled or not.
Definition Fl_Table.H:649
void when(Fl_When flags)
The Fl_Widget::when() function is used to set a group of flags, determining when the widget callback ...
void row_position(int row)
Sets the row scroll position to 'row', and causes the screen to redraw.
Definition Fl_Table.cxx:29
void col_header_color(Fl_Color val)
Sets the color for column headers and redraws the table.
Definition Fl_Table.H:730
int col_position()
Returns the current column scroll position as a column number.
Definition Fl_Table.H:811
void scrollbar_size(int newSize)
Sets the pixel size of the scrollbars' troughs to newSize, in pixels.
Definition Fl_Table.H:1114
int row_resize()
Returns if row resizing by the user is allowed.
Definition Fl_Table.H:584
void col_resize(int flag)
Allows/disallows column resizing by the user.
Definition Fl_Table.H:610
int rows()
Returns the number of rows in the table.
Definition Fl_Table.H:522
void callback(Fl_Widget *, void *)
Callbacks will be called depending on the setting of Fl_Widget::when().