Date: Thu, 3 Jul 2014 05:03:08 -0700
From: svetlana...@gmail.com
To: fltkg...@googlegroups.com
Subject: [fltk.general] draw_cell Method (Fl_Table)?
> Basically I'm asking, is it passed automatically or do I have to specify each context?
Hello.
The `contex' will be inserted by basic draw methods automatically in needed places in the parents classes.
You have to realize drawings for the contexts in the User Method's `draw_cell'.
Greg is author that class, and if hi will have a time you get fully details answer to your question.
Also you can look at fltk-1.3.x/examples/table* sources.
--
the best regards
InstructorForDrawingTable { // class Fl_Table
// instructor has number rosw/cols & them w/h, enabling headers etc...
for_each_row() {
UserDoNeedDrawRow(CONTEXT_ROW, x, y, w, h) // call user's method draw_cell
for_each_col() {
UserDoNeedDrawCell(CONTEXT_CELL, x, y, w, h) // call user's method draw_cell
}
}
}
Date: Thu, 3 Jul 2014 19:24:12 -0700
From: svetlana...@gmail.com
To: fltkg...@googlegroups.com
Subject: Re: [fltk.general] draw_cell Method (Fl_Table)?
Context sendings by events in `handle' method ...
strings: 747, 765 ...
Fl_Table::TableContext Fl_Table::cursor2rowcol(int &R, int &C, ResizeFlag &resizeflag) {
// return values
R = C = 0;
resizeflag = RESIZE_NONE;
// Row header?
int X, Y, W, H;
if ( row_header() ) {
// Inside a row heading?
get_bounds(CONTEXT_ROW_HEADER, X, Y, W, H);
if ( Fl::event_inside(X, Y, W, H) ) {
// Scan visible rows until found
for ( R = toprow; R <= botrow; R++ ) {
find_cell(CONTEXT_ROW_HEADER, R, 0, X, Y, W, H);
if ( Fl::event_y() >= Y && Fl::event_y() < (Y+H) ) {
// Found row?
// If cursor over resize boundary, and resize enabled,
// enable the appropriate resize flag.
//
if ( row_resize() ) {
if ( Fl::event_y() <= (Y+3-0) ) { resizeflag = RESIZE_ROW_ABOVE; }
if ( Fl::event_y() >= (Y+H-3) ) { resizeflag = RESIZE_ROW_BELOW; }
}
return(CONTEXT_ROW_HEADER);
}
}
// Must be in row header dead zone
return(CONTEXT_NONE);
}
Fl_Table::CONTEXT_STARTPAGE
|
When table, or parts of the table, are
about to be redrawn. R/C will be zero, |
Fl_Table::CONTEXT_ENDPAGE
|
When table has completed being redrawn. R/C will be zero, X/Y/W/H dimensions of table's data area. (Useful for unlocking a database after accessing) |
Fl_Table::CONTEXT_ROW_HEADER
|
Whenever a row header cell needs to be drawn. R will be the row number of the header being redrawn, C will be zero, X/Y/W/H will be the fltk drawing area of the row header in the window |
Fl_Table::CONTEXT_COL_HEADER
|
Whenever a column header cell needs to be drawn. R will be zero, C will be the column number of the header being redrawn, X/Y/W/H will be the fltk drawing area of the column header in the window |
Fl_Table::CONTEXT_CELL
|
Whenever a data cell in the table needs to be drawn. R/C will be the row/column of the cell to be drawn, X/Y/W/H will be the fltk drawing area of the cell in the window |
Fl_Table::CONTEXT_RC_RESIZE
|
Whenever table or row/column is resized
or scrolled, either interactively or via col_width() or row_height(). Useful for fltk containers that need to resize or move the child fltk widgets. |