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.
Public Member Functions | |
int | handle (int) |
void | pagesize (int a) |
int | pagesize () const |
Scrollbar (int x, int y, int w, int h, const char *l=0) | |
bool | value (int position, int size, int top, int total) |
bool | value (int position) |
int | value () const |
Static Public Attributes | |
static NamedStyle * | default_style |
Protected Member Functions | |
void | draw () |
|
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. |
|
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. |