# WoopsiUI::ScrollbarHorizontal Class Reference

`#include <scrollbarhorizontal.h>`

Inheritance diagram for WoopsiUI::ScrollbarHorizontal:

List of all members.

## Public Member Functions
| ScrollbarHorizontal (s16 x, s16 y, u16 width, u16 height, GadgetStyle *style=NULL)
const s16 | getMinimumValue () const
const s16 | getMaximumValue () const
const s16 | getValue () const
const s16 | getPageSize () const
void | setMinimumValue (const s16 value)
void | setMaximumValue (const s16 value)
void | setValue (const s16 value)
void | setValueWithBitshift (const s32 value)
void | setPageSize (const s16 pageSize)
virtual void | handleActionEvent (const GadgetEventArgs &e)
virtual void | handleClickEvent (const GadgetEventArgs &e)
virtual void | handleReleaseEvent (const GadgetEventArgs &e)
virtual void | handleReleaseOutsideEvent (const GadgetEventArgs &e)
virtual void | handleValueChangeEvent (const GadgetEventArgs &e)
## Protected Member Functions
virtual void | onResize (u16 width, u16 height)
virtual | ~ScrollbarHorizontal ()
| ScrollbarHorizontal (const ScrollbarHorizontal &scrollbarHorizontal)
## Protected Attributes
SliderHorizontal * | _slider
Button * | _leftButton
Button * | _rightButton
u8 | _buttonWidth
u8 | _scrollTimeout
WoopsiTimer * | _timer

## Detailed Description

Container class that holds a slider gadget and two arrow buttons. The interface is presents is virtually identical to the SliderHorizontal gadget, which means the two are easily interchangeable. All events raised by the internal slider gadget are re-raised by this gadget to this gadget's event handler, meaning its events are also identical to the SliderHorizontal's.

## Constructor & Destructor Documentation

WoopsiUI::ScrollbarHorizontal::ScrollbarHorizontal | ( | s16 | x,
|  | s16 | y,
|  | u16 | width,
|  | u16 | height,
|  | GadgetStyle * | style = `NULL` |
| ) |  |  |

Constructor.

Parameters:

  | x | The x co-ord of the slider, relative to its parent.
  | y | The y co-ord of the slider, relative to its parent.
  | width | The width of the slider.
  | height | The height of the slider.
  | style | The style that the gadget should use. If this is not specified, the gadget will use the values stored in the global defaultGadgetStyle object. The gadget will copy the properties of the style into its own internal style object.

virtual WoopsiUI::ScrollbarHorizontal::~ScrollbarHorizontal | ( |  | ) | `[inline, protected, virtual]`

Destructor.

WoopsiUI::ScrollbarHorizontal::ScrollbarHorizontal | ( | const ScrollbarHorizontal & | scrollbarHorizontal | ) | `[inline, protected]`

Copy constructor is protected to prevent usage.

## Member Function Documentation

const s16 WoopsiUI::ScrollbarHorizontal::getMaximumValue | ( |  | ) | const`[virtual]`

Get the largest value that the slider can represent.

Returns:
  The largest value.

Implements WoopsiUI::SliderBase.

const s16 WoopsiUI::ScrollbarHorizontal::getMinimumValue | ( |  | ) | const`[virtual]`

Get the smallest value that the slider can represent.

Returns:
  The smallest value.

Implements WoopsiUI::SliderBase.

const s16 WoopsiUI::ScrollbarHorizontal::getPageSize | ( |  | ) | const`[virtual]`

Get the value represented by the height of the grip. For sliders, this would typically be 1 (so each new grip position is worth 1). For scrollbars, this would be the height of the scrolling gadget.

Returns:
  The page size.

Implements WoopsiUI::SliderBase.

const s16 WoopsiUI::ScrollbarHorizontal::getValue | ( |  | ) | const`[virtual]`

Get the current value of the slider. return The current slider value.

Implements WoopsiUI::SliderBase.

virtual void WoopsiUI::ScrollbarHorizontal::handleActionEvent | ( | const GadgetEventArgs & | e | ) | `[virtual]`

Process events fired by the grip.

Parameters:

  | e | The event details.

Reimplemented from WoopsiUI::GadgetEventHandler.

virtual void WoopsiUI::ScrollbarHorizontal::handleClickEvent | ( | const GadgetEventArgs & | e | ) | `[virtual]`

Process events fired by the grip.

Parameters:

  | e | The event details.

Reimplemented from WoopsiUI::GadgetEventHandler.

virtual void WoopsiUI::ScrollbarHorizontal::handleReleaseEvent | ( | const GadgetEventArgs & | e | ) | `[virtual]`

Process events fired by the grip.

Parameters:

  | e | The event details.

Reimplemented from WoopsiUI::GadgetEventHandler.

virtual void WoopsiUI::ScrollbarHorizontal::handleReleaseOutsideEvent | ( | const GadgetEventArgs & | e | ) | `[virtual]`

Process events fired by the grip.

Parameters:

  | e | The event details.

Reimplemented from WoopsiUI::GadgetEventHandler.

virtual void WoopsiUI::ScrollbarHorizontal::handleValueChangeEvent | ( | const GadgetEventArgs & | e | ) | `[virtual]`

Process events fired by the grip.

Parameters:

  | e | The event details.

Reimplemented from WoopsiUI::GadgetEventHandler.

virtual void WoopsiUI::ScrollbarHorizontal::onResize | ( | u16 | width,
|  | u16 | height |
| ) |  |  | `[protected, virtual]`

Resize the scrollbar to the new dimensions.

Parameters:

  | width | The new width.
  | height | The new height.

Reimplemented from WoopsiUI::Gadget.

void WoopsiUI::ScrollbarHorizontal::setMaximumValue | ( | const s16 | value | ) | `[virtual]`

Set the largest value that the slider can represent.

Parameters:

  | value | The largest value.

Implements WoopsiUI::SliderBase.

void WoopsiUI::ScrollbarHorizontal::setMinimumValue | ( | const s16 | value | ) | `[virtual]`

Set the smallest value that the slider can represent.

Parameters:

  | value | The smallest value.

Implements WoopsiUI::SliderBase.

void WoopsiUI::ScrollbarHorizontal::setPageSize | ( | const s16 | pageSize | ) | `[virtual]`

Set the page size represented by the grip.

Parameters:

  | pageSize | The page size.

See also:
  getPageSize().

Implements WoopsiUI::SliderBase.

void WoopsiUI::ScrollbarHorizontal::setValue | ( | const s16 | value | ) | `[virtual]`

Set the value that of the slider. This will reposition and redraw the grip.

Parameters:

  | value | The new value.

Implements WoopsiUI::SliderBase.

void WoopsiUI::ScrollbarHorizontal::setValueWithBitshift | ( | const s32 | value | ) | `[virtual]`

Set the value that of the slider. This will reposition and redraw the grip. The supplied value should be bitshifted left 16 places. This ensures greater accuracy than the standard setValue() method if the slider is being used as a scrollbar.

Parameters:

  | value | The new value.

Implements WoopsiUI::SliderBase.

## Member Data Documentation

u8 WoopsiUI::ScrollbarHorizontal::_buttonWidth`[protected]`

Width of the buttons

Button* WoopsiUI::ScrollbarHorizontal::_leftButton`[protected]`

Pointer to the left button

Button* WoopsiUI::ScrollbarHorizontal::_rightButton`[protected]`

Pointer to the right button

u8 WoopsiUI::ScrollbarHorizontal::_scrollTimeout`[protected]`

VBLs needed until a button triggers another grip movement

SliderHorizontal* WoopsiUI::ScrollbarHorizontal::_slider`[protected]`

Pointer to the slider gadget

WoopsiTimer* WoopsiUI::ScrollbarHorizontal::_timer`[protected]`

Controls slider button repeats

The documentation for this class was generated from the following file:

- scrollbarhorizontal.h