I’ve since found out I could use Fl_Table_Row::wix and Fl_Table_Row::wiy, I had a vague remembrance they were there, but couldn’t find the article about them. I came across I had used tih in my code so searched that in the manual and found the others.
I know I’ve top-posted, but I cant be bothered the rigmarole to bottom post.
Phil.
Sent from Mail for Windows 10
From: Greg Ercolano
Sent: 30 November 2020 23:43
To: fltkgeneral@googlegroups.com
Subject: Re: [fltk.general] Getting text into the top-left "cell" in Fl_Table_Row
On 2020-11-30 14:44, 'Philip Rose' via fltk.general wrote:
In the shown example, it’s the place to the left of where it says “Date” and above the place where it has “2925”. I would like to write into there.
Oh, that little area is neither cell nor header.. that's a perfect use for CONTEXT_ENDPAGE.
Here's how to write to that area, shown by drawing an "X":
case CONTEXT_ENDPAGE: { // after page headers/cells are drawn..
// Draw black 'x' in the dead area
int X1=x(), Y1=y(), X2=x()+row_header_width(), Y2=y()+col_header_height();
fl_color(FL_BLACK);
fl_line(X1,Y1,X2,Y2);
fl_line(X1,Y2,X2,Y1);
return;
}
Thanks Greg,
Looks like I had originally tried to display the text in the top-left of the window.
I had to tweak the code slightly to get the box to line up with the column headers:
case CONTEXT_ENDPAGE:
{
// Code trying to write text into the top-left corner
// Set the font for the header header
fl_font(fl_font() | FL_ITALIC, fontsize_);
// Set the col header row header crossing point
fl_color(col_header_color());
int X1 = x() + Fl::box_dx(box());
int Y1 = y() + Fl::box_dy(box());
int W1 = row_header_width();
int H1 = col_header_height();
fl_draw_box(FL_BORDER_BOX, X1, Y1, W1, H1, col_header_color());
// Text color
fl_color(FL_BLACK);
fl_draw("QSO No.", X1, Y1, W1, H1, FL_ALIGN_CENTER);
return;
}
Regards Phil.
--
You received this message because you are subscribed to a topic in the Google Groups "fltk.general" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fltkgeneral/KDDLWooAfAU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/5fc6613f.1c69fb81.139f8.3b14SMTPIN_ADDED_BROKEN%40gmr-mx.google.com.