Public Member Functions | |
Scrollbar (int x, int y, int w, int h, const char *l=0) | |
int | value () |
int | value (int position, int size, int top, int total) |
int | handle (int) |
int | pagesize () const |
void | pagesize (int a) |
Static Public Attributes | |
NamedStyle * | default_style |
Protected Member Functions | |
void | draw () |
The Scrollbar widget displays a slider with arrow buttons at the ends of the scrollbar. Clicking on the arrows move up/left and down/right by linesize(). If the scrollbar has the keyboard focus the arrows move by linesize(), and vertical scrollbars take Page Up/Down (they move by the page size minus linesize()) and Home/End (they jump to the top or bottom). Often a widget that takes focus such as the browser will just send keystrokes to the scrollbar directly to get it to move in response.
|
How much the pageup/down keys and clicking in the empty area move by. If you call value() this is set to 1 linesize() less than the window. |
|
Set the current position, the range, the pagesize, and the slider_size() all at once in a useful way. p = the position in the data of the first pixel in the window w = the size of the window t = the position of the top of your data (typically zero) l = the total size of your data. |
|
Return the current position of the scrollbar as an integer. Scrollbars have step(1) preset (they always return integers). If desired you can set the step() to non-integer values. You will then have to use casts to get at the floating-point versions of value() from the Slider baseclass. |