Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

ScrollBar Class Reference

A scroll bar. More...

#include <ScrollBar.h>

Inheritance diagram for ScrollBar:
Container Control Broadcaster Listener

List of all members.

Public Member Functions

 ScrollBar (const std::string &name, int height, SliderType type=SLIDER_VERTICAL)
 ~ScrollBar ()
double getPosition () const
void setPosition (double position)
double getStepSize () const
void setStepUnits (Uint units)

Protected Member Functions

void initialize ()
void logic ()
void push (Event *event)

Private Member Functions

void onChanged (Event *event)

Private Attributes

Timer mTimer
SlidermSlider
ButtonmDecreaseButton
ButtonmIncreaseButton
Uint mPressedTick
Uint mScrolledTick
Uint mNumStepUnits
double mStepSize
bool mIsDecreasing
bool mIsInreasing
bool mIsScrolling

Detailed Description

A scroll bar.

Implementation of a ScrollBar.

Todo:
Currently only supports Vertical scroll bars.

Constructor & Destructor Documentation

ScrollBar::ScrollBar ( const std::string &  name,
int  height,
SliderType  type = SLIDER_VERTICAL 
)
ScrollBar::~ScrollBar (  )  [inline]

Member Function Documentation

double ScrollBar::getPosition (  )  const

Gets the current position of the ScrollBar.

double ScrollBar::getStepSize (  )  const
void ScrollBar::initialize (  )  [protected, virtual]

Initialize all internal variables, and any child controls needed.

Todo:
I would like to go through all of the code here and clean it up as best as possible. It's a bit cludgy and I'm sure it can be done a little better.

Reimplemented from Container.

void ScrollBar::logic (  )  [protected, virtual]

Not sure I can really comment this any more than the code already documents it.

Reimplemented from Container.

void ScrollBar::onChanged ( Event event  )  [private, virtual]

Called whenever a Control's data changes.

Reimplemented from Control.

void ScrollBar::push ( Event event  )  [protected, virtual]

Reimplemented from Control.

void ScrollBar::setPosition ( double  position  ) 
void ScrollBar::setStepUnits ( Uint  units  ) 

Sets the number of step units for the ScrollBar.

Parameters:
units Number of step units.

Member Data Documentation

Decrease Slider Position Button.

Increase Slider Position Button.

bool ScrollBar::mIsDecreasing [private]

Flag indicating that we're decreasing.

bool ScrollBar::mIsInreasing [private]

Flag indicating that we're inreasing.

bool ScrollBar::mIsScrolling [private]

Flad indicating that we're past the initial wait delay.

Number of step units for this scroll bar.

Internal time when pressed note.

Internal time when last changed slider position.

Internal Slider.

double ScrollBar::mStepSize [private]

Size of the step to take per scroll unit.

Internal timer used to slow down the progress of the thumb.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines