Return to Index

Scrollbar

Parent class: Valuator

This class provides a horizontal or vertical scrollbar to provide scrolling capabilities, or a numeric input mechanism. Most methods generally used with a scrollbar are handled by the parent class Valuator.


Method Summary:
Scrollbar::Scrollbar();
void Scrollbar::setVertical(bool b);
void Scrollbar::setSliderSize(float f);
float Scrollbar::getSliderSize();
int Scrollbar::getIntValue();
int Scrollbar::setScrollValue(int position, int size, int top, int total);
void Scrollbar::setLineSize(int i);
int Scrollbar::getLineSize();



Scrollbar::Scrollbar
Scrollbar::Scrollbar();

Constructs a new Scrollbar widget.

void Scrollbar::setVertical
void Scrollbar::setVertical(bool b);

Sets the orientation for the scrollbar. The default is horizontal.
Parameters:
bool bTrue for a vertical scrollbar.

void Scrollbar::setSliderSize
void Scrollbar::setSliderSize(float f);

Sets the dimension of the moving part of the slider. This is the fraction of the size of the whole widget. The default is 0.08.
Parameters:
float fThe percent of the size of the widget to make the sliding part.

float Scrollbar::getSliderSize
float Scrollbar::getSliderSize();

Returns the size of the slider as a precentage of the size of the whole widget.

int Scrollbar::getIntValue
int Scrollbar::getIntValue();

Returns the integer value of the slider. To get the floating point value, use Valuator::getValue().

int Scrollbar::setScrollValue
int Scrollbar::setScrollValue(int position, int size, int top, int total);

Sets the range, value, and slider size of the scrollbar to make a variable sized one. This method should be called from the callback, including when the data changes size, the window is resized, or the scroll position changes.
Parameters:
int positionThe current position.
int sizeThe size of the data unit.
int topThe topmost visible unit of the data.
int totalThe number of data units.

void Scrollbar::setLineSize
void Scrollbar::setLineSize(int i);

Controls how big the steps are that the arrow keys make. The default is 16.
Parameters:
int iThe number of steps to take for an arrow key press.

int Scrollbar::getLineSize
int Scrollbar::getLineSize();

Returns the number of steps take for an arrow key press.


Generated automatically by docgen 0.0.1
© 2003 Aron Dobos