DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2156
Version: 1.3-current


In trying to use the docs for Fl_Scrollbar::value(int,int,int,int), I found
very wrong inconsistencies.

Specifically:
http://fltk.org/doc-1.3/classFl__Scrollbar.html#c77d402598c922f8eae9987021d84119

There are a few things:

     1) The docs describe two overloaded methods but only show one
     2) The docs for value(a,b,c,d) don't match the actual arguments

Currently the docs read (my comments in uppercase)
----
int Fl_Scrollbar::value() const [inline]   <-- ONLY FIRST FORM IS SHOWN
                                           <-- NEEDS TO SHOW SECOND FORM

The first form returns the integer value of the scrollbar.

You can get the floating point value with Fl_Slider::value(). 
The second form sets value(), range(), and slider_size() <-- NOT CORRECT 
to make a variable-sized scrollbar. You should call this every time your
window changes size, your data changes size, or your scroll position
changes (even if in response to a callback from this scrollbar). All
necessary calls to redraw() are done.

Reimplemented from Fl_Valuator.   <-- PROBABLY MEANS Fl_Slider
----

To fix the above, both prototypes should be shown, eg:

int Fl_Scrollbar::value() const [inline]
void Fl_Scrollbar::value(int p, int s, int top, int total) <-- ADD THIS

Also, the names of these arguments could be improved, as 'p' and 's' give
no hint as to their meaning. In actuality, RTSL reveals
value(int,int,int,int) is implemented as a call to
Fl_Slider::scrollvalue(int,int,int,int), and whose arguments are named:

    int windowtop,
    int windowsize,
    int first,
    int totalsize

..so it is these names, or something like them, that should be used for
consistency, and their values described specifically.

I tried looking at the docs for scrollvalue(), but its docs are also
unclear, which is probably a separate issue that should be addressed.

Finally, this sentence in the current docs are misleading:

    "The second form sets value(), range(), and slider_size().."

This would seem to be referring to Fl_Slider::slider_size(double) and
Fl_Valuator::range(double,double) which both expect floating point values.
This can't be right, as these arguments are all integers.

I don't think the way the docs currently read, one can determine how to
make the widget work correctly.


Link: http://www.fltk.org/str.php?L2156
Version: 1.3-current

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

Reply via email to