|
|
Author: engelsman
Date: 2009-03-11 15:15:14 -0700 (Wed, 11 Mar 2009)
New Revision: 6674
Log:
updated Fl_Scrollbar::value() description (STR #2156 - part 1)
further rework needed on Fl_Slider::scrollvalue() description
Modified:
branches/branch-1.3/FL/Fl_Scrollbar.H
branches/branch-1.3/src/Fl_Slider.cxx
Modified: branches/branch-1.3/FL/Fl_Scrollbar.H
===================================================================
--- branches/branch-1.3/FL/Fl_Scrollbar.H 2009-03-09 20:58:27 UTC (rev 6673)
+++ branches/branch-1.3/FL/Fl_Scrollbar.H 2009-03-11 22:15:14 UTC (rev 6674)
@@ -63,21 +63,38 @@
int handle(int);
/**
- 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()
- 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.
+ Gets the integer value (position) of the slider in the scrollbar.
+ You can get the floating point value with Fl_Slider::value().
+ \see Fl_Scrollbar::value(int p)
+ \see Fl_Scrollbar::value(int p, int s, int top, int total)
*/
int value() const {return int(Fl_Slider::value());}
- /** See int Fl_Scrollbar::value() */
+
+ /**
+ Sets the value (position) of the slider in the scrollbar.
+ \see Fl_Scrollbar::value()
+ \see Fl_Scrollbar::value(int p, int s, int top, int total)
+ */
int value(int p) {return int(Fl_Slider::value((double)p));}
- /** See int Fl_Scrollbar::value() */
+
+ /**
+ Sets the position, size and range of the slider in the scrollbar.
+ \param[in] p position, first line displayed
+ \param[in] s window size, number of lines displayed
+ \param[in] top number of first line
+ \param[in] total total number of lines
+
+ 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.
+
+ Calls Fl_Slider::scrollvalue(int p, int s, int top, int total).
+ */
int value(int p, int s, int top, int total) {
return scrollvalue(p, s, top, total);
}
+
/**
This number controls how big the steps are that the arrow keys do. In
addition page up/down move by the size last sent to value()
Modified: branches/branch-1.3/src/Fl_Slider.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Slider.cxx 2009-03-09 20:58:27 UTC (rev 6673)
+++ branches/branch-1.3/src/Fl_Slider.cxx 2009-03-11 22:15:14 UTC (rev 6674)
@@ -79,12 +79,15 @@
}
}
-/** Returns Fl_Scrollbar::value(). */
+/**
+ Sets the size and position of the sliding knob in the box.
+ \param[in] p position, first line displayed
+ \param[in] W window, number of lines displayed
+ \param[in] t top, number of first line
+ \param[in] l length, total number of lines
+ Returns Fl_Valuator::value(p)
+ */
int Fl_Slider::scrollvalue(int p, int W, int t, int l) {
-// p = position, first line displayed
-// w = window, number of lines displayed
-// t = top, number of first line
-// l = length, total number of lines
step(1, 1);
if (p+W > t+l) l = p+W-t;
slider_size(W >= l ? 1.0 : double(W)/double(l));
[ Direct Link to Message ] | |
|
| |