|
|
Hi,
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_HEADER section
   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;
       [..]
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/65d32c9f-72fc-6153-3ae9-5f44e80297a9%40seriss.com.
[ Direct Link to Message ] | |
|
| |