fltk::Scrollbar Class Reference

Inherits fltk::Slider.

List of all members.


Detailed Description

scrollbar.gif

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 NamedStyledefault_style

Protected Member Functions

void draw ()


Member Function Documentation

bool Scrollbar::value int  p,
int  w,
int  t,
int  l
 

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.

void Scrollbar::pagesize int  a  )  [inline]
 

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.


Fri Apr 2 15:19:55 2010. FLTK ©2007 Bill Spitzak and others.
Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.