summaryrefslogtreecommitdiff
path: root/FL/Fl_Table.H
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2025-01-14 15:21:42 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2025-01-14 15:21:42 +0100
commita48ebc5db02960165bf1b9fb64443a5cdf9635d5 (patch)
tree0b87e53d4238d4aeb7b56601b0a4159ff79054a2 /FL/Fl_Table.H
parent06418e4b219add0ff31186effbdd01ecb0f00a28 (diff)
Fix return value of Fl_Table_Row::row_selected(int) (PR #1187)
As discussed in the context of PR #1187 the previous return value '-1' was misleading and undocumented. The docs mentioned only '1' and '0'. User code that used the return value as documented (like a `bool`) would make the wrong decision if the return value was '-1': true (selected) instead false (out of range). This commit fixes the code by doing what the docs define and clarifies the documentation. Further documentation improvements of Fl_Table (example code used a method that is not defined in Fl_Table) and of Fl_Table_Row are included as well. Doxygen docs of two methods of Fl_Table_Row moved to the .cxx file where they belong according to the CMP.
Diffstat (limited to 'FL/Fl_Table.H')
-rw-r--r--FL/Fl_Table.H2
1 files changed, 1 insertions, 1 deletions
diff --git a/FL/Fl_Table.H b/FL/Fl_Table.H
index 746b3a37d..7fb80cd04 100644
--- a/FL/Fl_Table.H
+++ b/FL/Fl_Table.H
@@ -351,7 +351,7 @@ protected:
fl_push_clip(X, Y, W, H);
{
// BG COLOR
- fl_color( row_selected(R) ? selection_color() : FL_WHITE);
+ fl_color(is_selected(R, C) ? selection_color() : FL_WHITE);
fl_rectf(X, Y, W, H);
// TEXT