Scrollbar Class Reference

Inherits Slider.

List of all members.

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

NamedStyledefault_style

Protected Member Functions

void draw ()


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.


Member Function Documentation

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.

int 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.

int Scrollbar::value  )  [inline]
 

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.


The documentation for this class was generated from the following files:
Sun Jan 7 00:55:18 2007. FLTK ©2006 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.