# WoopsiUI::ScrollbarPanel Class Reference

`#include <scrollbarpanel.h>`

Inheritance diagram for WoopsiUI::ScrollbarPanel:

List of all members.

## Public Member Functions
| ScrollbarPanel (s16 x, s16 y, u16 width, u16 height, u32 flags, GadgetStyle *style=NULL)
virtual void | scroll (s32 dx, s32 dy)
virtual void | jump (s32 x, s32 y)
virtual void | setAllowsVerticalScroll (bool allow)
virtual void | setAllowsHorizontalScroll (bool allow)
virtual void | setCanvasWidth (const s32 width)
virtual void | setCanvasHeight (const s32 height)
virtual bool | allowsVerticalScroll () const
virtual bool | allowsHorizontalScroll () const
virtual const s32 | getCanvasX () const
virtual const s32 | getCanvasY () const
virtual const s32 | getCanvasWidth () const
virtual const s32 | getCanvasHeight () const
void | handleScrollEvent (const GadgetEventArgs &e)
void | handleValueChangeEvent (const GadgetEventArgs &e)
ScrollingPanel * | getPanel ()
## Protected Member Functions
void | buildUI ()
virtual void | drawContents (GraphicsPort *port)
virtual | ~ScrollbarPanel ()
| ScrollbarPanel (const ScrollbarPanel &scrollbarPanel)
## Protected Attributes
ScrollingPanel * | _panel
ScrollbarHorizontal * | _scrollbarHorizontal
ScrollbarVertical * | _scrollbarVertical
u8 | _scrollbarWidth
u8 | _scrollbarHeight
bool | _hasVerticalScrollbar
bool | _hasHorizontalScrollbar

## Detailed Description

Class containing a scrolling panel bordered by scrollbars.

## Constructor & Destructor Documentation

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

Constructor.

Parameters:

  | x | The x co-ordinate of the gadget.
  | y | The y co-ordinate of the gadget.
  | width | The width of the gadget.
  | height | The height of the gadget.
  | flags | The usual gadget flags.
  | 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::ScrollbarPanel::~ScrollbarPanel | ( |  | ) | `[inline, protected, virtual]`

Destructor.

WoopsiUI::ScrollbarPanel::ScrollbarPanel | ( | const ScrollbarPanel & | scrollbarPanel | ) | `[inline, protected]`

Copy constructor is protected to prevent usage.

## Member Function Documentation

virtual bool WoopsiUI::ScrollbarPanel::allowsHorizontalScroll | ( |  | ) | const`[virtual]`

Returns true if horizontal scrolling is allowed.

Returns:
  True if horizontal scrolling is allowed.

Implements WoopsiUI::ScrollableBase.

virtual bool WoopsiUI::ScrollbarPanel::allowsVerticalScroll | ( |  | ) | const`[virtual]`

Returns true if vertical scrolling is allowed.

Returns:
  True if vertical scrolling is allowed.

Implements WoopsiUI::ScrollableBase.

void WoopsiUI::ScrollbarPanel::buildUI | ( |  | ) | `[protected]`

Creates the child gadgets.

virtual void WoopsiUI::ScrollbarPanel::drawContents | ( | GraphicsPort * | port | ) | `[protected, virtual]`

Draw the area of this gadget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

Parameters:

  | port | The GraphicsPort to draw to.

See also:
  redraw()

Reimplemented from WoopsiUI::Gadget.

virtual const s32 WoopsiUI::ScrollbarPanel::getCanvasHeight | ( |  | ) | const`[virtual]`

Gets the height of the virtual canvas.

Returns:
  The height of the virtual canvas.

Implements WoopsiUI::ScrollableBase.

virtual const s32 WoopsiUI::ScrollbarPanel::getCanvasWidth | ( |  | ) | const`[virtual]`

Gets the width of the virtual canvas.

Returns:
  The width of the virtual canvas.

Implements WoopsiUI::ScrollableBase.

virtual const s32 WoopsiUI::ScrollbarPanel::getCanvasX | ( |  | ) | const`[virtual]`

Gets the x co-ordinate of the virtual canvas.

Returns:
  The x co-ordinate of the virtual canvas.

Implements WoopsiUI::ScrollableBase.

virtual const s32 WoopsiUI::ScrollbarPanel::getCanvasY | ( |  | ) | const`[virtual]`

Gets the y co-ordinate of the virtual canvas.

Returns:
  The y co-ordinate of the virtual canvas.

Implements WoopsiUI::ScrollableBase.

ScrollingPanel* WoopsiUI::ScrollbarPanel::getPanel | ( |  | ) | `[inline]`

Gets a pointer to the ScrollingPanel gadget contained within this gadget.

Returns:
  A pointer to the ScrollingPanel gadget.

void WoopsiUI::ScrollbarPanel::handleScrollEvent | ( | const GadgetEventArgs & | e | ) | `[virtual]`

Handle a gadget scroll event.

Parameters:

  | e | The event data.

Reimplemented from WoopsiUI::GadgetEventHandler.

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

Handle a gadget value change event.

Parameters:

  | e | The event data.

Reimplemented from WoopsiUI::GadgetEventHandler.

virtual void WoopsiUI::ScrollbarPanel::jump | ( | s32 | x,
|  | s32 | y |
| ) |  |  | `[virtual]`

Reposition the panel's scrolling region to the specified co-ordinates.

Parameters:

  | x | The new x co-ordinate of the scrolling region.
  | y | The new y co-ordinate of the scrolling region.

Implements WoopsiUI::ScrollableBase.

virtual void WoopsiUI::ScrollbarPanel::scroll | ( | s32 | dx,
|  | s32 | dy |
| ) |  |  | `[virtual]`

Scroll the panel by the specified amounts.

Parameters:

  | dx | The horizontal distance to scroll.
  | dy | The vertical distance to scroll.

Implements WoopsiUI::ScrollableBase.

virtual void WoopsiUI::ScrollbarPanel::setAllowsHorizontalScroll | ( | bool | allow | ) | `[virtual]`

Set whether or not horizontal scrolling is allowed.

Parameters:

  | allow | True to allow horizontal scrolling; false to deny it.

Implements WoopsiUI::ScrollableBase.

virtual void WoopsiUI::ScrollbarPanel::setAllowsVerticalScroll | ( | bool | allow | ) | `[virtual]`

Set whether or not horizontal scrolling is allowed.

Parameters:

  | allow | True to allow horizontal scrolling; false to deny it.

Implements WoopsiUI::ScrollableBase.

virtual void WoopsiUI::ScrollbarPanel::setCanvasHeight | ( | const s32 | height | ) | `[virtual]`

Sets the height of the virtual canvas.

Parameters:

  | height | The height of the virtual canvas.

Implements WoopsiUI::ScrollableBase.

virtual void WoopsiUI::ScrollbarPanel::setCanvasWidth | ( | const s32 | width | ) | `[virtual]`

Sets the width of the virtual canvas.

Parameters:

  | width | The width of the virtual canvas.

Implements WoopsiUI::ScrollableBase.

## Member Data Documentation

bool WoopsiUI::ScrollbarPanel::_hasHorizontalScrollbar`[protected]`

Indicates the presence of a horizontal scrollbar.

bool WoopsiUI::ScrollbarPanel::_hasVerticalScrollbar`[protected]`

Indicates the presence of a vertical scrollbar.

ScrollingPanel* WoopsiUI::ScrollbarPanel::_panel`[protected]`

Internal panel that contains children.

u8 WoopsiUI::ScrollbarPanel::_scrollbarHeight`[protected]`

Height of the horizontal scrollbar.

ScrollbarHorizontal* WoopsiUI::ScrollbarPanel::_scrollbarHorizontal`[protected]`

Horizontal scrollbar.

ScrollbarVertical* WoopsiUI::ScrollbarPanel::_scrollbarVertical`[protected]`

Vertical scrollbar.

u8 WoopsiUI::ScrollbarPanel::_scrollbarWidth`[protected]`

Width of the vertical scrollbar.

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

- scrollbarpanel.h