diff --git a/FL/Fl_Table.H b/FL/Fl_Table.H index 898ba1afa..bce1e5519 100644 --- a/FL/Fl_Table.H +++ b/FL/Fl_Table.H @@ -26,6 +26,7 @@ // TODO: // o Auto scroll during dragged selection // o Keyboard navigation (up/down/left/right arrow) +// o Add scrollbar_size() method and integer [breaks ABI] // #ifndef _FL_TABLE_H @@ -218,6 +219,7 @@ private: int _auto_drag; int _selecting; + //int _scrollbar_size; // TODO: BREAKS ABI // An STL-ish vector without templates class FL_EXPORT IntVector { @@ -1072,6 +1074,8 @@ public: */ void callback(Fl_Widget*, void*); #endif + //int scrollbar_size() const { // TODO: BREAKS ABI + //void scrollbar_size(int size) { // TODO: BREAKS ABI }; #endif /*_FL_TABLE_H*/ diff --git a/src/Fl_Table.cxx b/src/Fl_Table.cxx index 6b73879ce..070e9e545 100644 --- a/src/Fl_Table.cxx +++ b/src/Fl_Table.cxx @@ -30,7 +30,7 @@ #include // currently only Windows and Linux #endif -#define SCROLLBAR_SIZE 16 +#define SCROLLBAR_SIZE (Fl::scrollbar_size()) // Scroll display so 'row' is at top void Fl_Table::row_position(int row) { @@ -1117,6 +1117,13 @@ void Fl_Table::set_selection(int row_top, int col_left, int row_bot, int col_rig // Then tell the group to draw over us. // void Fl_Table::draw() { + // Check if scrollbar size changed + if ( ( vscrollbar && (SCROLLBAR_SIZE != vscrollbar->w()) ) || + ( hscrollbar && (SCROLLBAR_SIZE != hscrollbar->h()) ) ) { + // handle size change, min/max, table dim's, etc + table_resized(); + } + draw_cell(CONTEXT_STARTPAGE, 0, 0, // let user's drawing routine tix, tiy, tiw, tih); // prep new page diff --git a/test/unittest_scrollbarsize.cxx b/test/unittest_scrollbarsize.cxx index b3079d6f9..d173bcc16 100644 --- a/test/unittest_scrollbarsize.cxx +++ b/test/unittest_scrollbarsize.cxx @@ -135,6 +135,7 @@ class ScrollBarSizeTest : public Fl_Group { if ( strcmp(label,"A: Scroll Size") == 0 ) { brow_a->scrollbar_size(val); tree_a->scrollbar_size(val); + //table_a->scrollbar_size(val); // awaiting method (ABI) } else { Fl::scrollbar_size(val); } @@ -211,7 +212,7 @@ public: "Scrollbar's size should change interactively as size sliders are changed.\n" "Changing 'Global Scroll Size' should affect all three browser's scrollbars UNLESS\n" "the 'A: Scroll Size' slider is changed, in which case its value will take precedence\n" - "for 'Browser A', and the global size will only affect Browser B and C."); + "for the 'A' group of widgets. (NOTE: 'table_a' does not currently support this)"); labelsize(10); align(FL_ALIGN_INSIDE|FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_WRAP); }