Author: greg.ercolano
Date: 2011-07-17 09:40:41 -0700 (Sun, 17 Jul 2011)
New Revision: 8863
Log:
Fixing STR #2679; Fl_Table makes use of FLTK's Fl::scrollbar_size() global.


Modified:
   branches/branch-1.3/FL/Fl_Table.H
   branches/branch-1.3/src/Fl_Table.cxx
   branches/branch-1.3/test/unittest_scrollbarsize.cxx

Modified: branches/branch-1.3/FL/Fl_Table.H
===================================================================
--- branches/branch-1.3/FL/Fl_Table.H   2011-07-16 03:50:58 UTC (rev 8862)
+++ branches/branch-1.3/FL/Fl_Table.H   2011-07-17 16:40:41 UTC (rev 8863)
@@ -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 @@
   
   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 @@
    */
   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*/

Modified: branches/branch-1.3/src/Fl_Table.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Table.cxx        2011-07-16 03:50:58 UTC (rev 
8862)
+++ branches/branch-1.3/src/Fl_Table.cxx        2011-07-17 16:40:41 UTC (rev 
8863)
@@ -30,7 +30,7 @@
 #include <FL/fl_utf8.H>        // 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 @@
 //    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
   

Modified: branches/branch-1.3/test/unittest_scrollbarsize.cxx
===================================================================
--- branches/branch-1.3/test/unittest_scrollbarsize.cxx 2011-07-16 03:50:58 UTC 
(rev 8862)
+++ branches/branch-1.3/test/unittest_scrollbarsize.cxx 2011-07-17 16:40:41 UTC 
(rev 8863)
@@ -135,6 +135,7 @@
        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 @@
            "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);
     }

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to