I am extending Fl_Table_Row to display records in a database.
I would like to add the column header of the [rows]. Is this
possible?
   Sure, be sure to turn on col_header(1)
and then in your draw_cell(), add your code to the
CONTEXT_COL_HEADERsection
   to draw the text inside the cell area for that column# (the XYWH
and COL values passed to you for those values respectively).
I tried to draw the text in draw_cell in the
CONTEXT_STARTPAGE and CONTEXT_ENDPAGE, but neither did what I
wanted. All I wanted to add was "Record No." or similar.
   The "CONTEXT_XXXPAGE" sections are just for drawing something
over the entire table like a background, floating text, or some
such.
   This is because the XYWH values at that time will be for the entire
table, not any particular row/column or cell, which
you'd need to know
   to draw each column's header.
   I suggest looking at the examples/table-simple.cxx
example program, and look at how the A/B/C/D.. column headers are
drawn, e.g.
 void draw_cell(TableContext context, int ROW=0, int COL=0,
int X=0, int Y=0, int W=0, int H=0) { Â Â [..]
  switch ( context ) {      [..]      case
CONTEXT_COL_HEADER:Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Draw column headers
       sprintf(s,"%c",'A'+COL);               // "A", "B",
"C", etc.
       DrawHeader(s,X,Y,W,H);
       return;        [..]
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.