Woopsi 1.3
Nintendo DS Gui Framework
Public Member Functions | Protected Member Functions | Protected Attributes
WoopsiUI::SliderHorizontal Class Reference

#include <libwoopsi/include/sliderhorizontal.h>

Inheritance diagram for WoopsiUI::SliderHorizontal:
WoopsiUI::SliderBase WoopsiUI::Gadget WoopsiUI::GadgetEventHandler

List of all members.

Public Member Functions

 SliderHorizontal (s16 x, s16 y, u16 width, u16 height)
const s16 getMinimumValue () const
const s16 getMaximumValue () const
const s32 getValue () const
const s16 getPageSize () const
void setMinimumValue (const s16 value)
void setMaximumValue (const s16 value)
void setValue (const s32 value)
void setPageSize (const s16 pageSize)
virtual void handleDragEvent (const GadgetEventArgs &e)
s16 getMinimumStep () const

Protected Member Functions

virtual void drawContents (GraphicsPort *port)
virtual void drawBorder (GraphicsPort *port)
virtual void onResize (u16 width, u16 height)
virtual void onClick (s16 x, s16 y)
virtual ~SliderHorizontal ()
 SliderHorizontal (const SliderHorizontal &sliderHorizontal)
void resizeGrip ()

Protected Attributes

SliderHorizontalGrip_grip
s16 _minimumValue
s16 _maximumValue
s32 _value
s16 _minimumGripWidth
s16 _pageSize

Detailed Description

Gadget providing a sliding "grip" that can be moved left and right in the "gutter". Essentially a scrollbar, but more generic.


Constructor & Destructor Documentation

WoopsiUI::SliderHorizontal::SliderHorizontal ( s16  x,
s16  y,
u16  width,
u16  height 
)

Constructor.

Parameters:
xThe x co-ord of the slider, relative to its parent.
yThe y co-ord of the slider, relative to its parent.
widthThe width of the slider.
heightThe height of the slider.
virtual WoopsiUI::SliderHorizontal::~SliderHorizontal ( ) [inline, protected, virtual]

Destructor.

WoopsiUI::SliderHorizontal::SliderHorizontal ( const SliderHorizontal sliderHorizontal) [inline, protected]

Copy constructor is protected to prevent usage.


Member Function Documentation

virtual void WoopsiUI::SliderHorizontal::drawBorder ( 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:
portThe GraphicsPort to draw to.
See also:
redraw()

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::SliderHorizontal::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:
portThe GraphicsPort to draw to.
See also:
redraw()

Reimplemented from WoopsiUI::Gadget.

const s16 WoopsiUI::SliderHorizontal::getMaximumValue ( ) const [inline, virtual]

Get the largest value that the slider can represent.

Returns:
The largest value.

Implements WoopsiUI::SliderBase.

s16 WoopsiUI::SliderHorizontal::getMinimumStep ( ) const

Get the smallest value that the slider can move through when dragged.

Returns:
The smallest value that the slider can move through when dragged.
const s16 WoopsiUI::SliderHorizontal::getMinimumValue ( ) const [inline, virtual]

Get the smallest value that the slider can represent.

Returns:
The smallest value.

Implements WoopsiUI::SliderBase.

const s16 WoopsiUI::SliderHorizontal::getPageSize ( ) const [inline, 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 s32 WoopsiUI::SliderHorizontal::getValue ( ) const [virtual]

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

Implements WoopsiUI::SliderBase.

virtual void WoopsiUI::SliderHorizontal::handleDragEvent ( const GadgetEventArgs e) [virtual]

Process events fired by the grip.

Parameters:
eThe event details.

Reimplemented from WoopsiUI::GadgetEventHandler.

virtual void WoopsiUI::SliderHorizontal::onClick ( s16  x,
s16  y 
) [protected, virtual]

Moves the grip towards the stylus.

Parameters:
xThe x co-ordinate of the click.
yThe y co-ordinate of the click.

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::SliderHorizontal::onResize ( u16  width,
u16  height 
) [protected, virtual]

Resize the slider to the new dimensions.

Parameters:
widthThe new width.
heightThe new height.

Reimplemented from WoopsiUI::Gadget.

void WoopsiUI::SliderHorizontal::resizeGrip ( ) [protected]

Resize and mark the grip for redraw.

void WoopsiUI::SliderHorizontal::setMaximumValue ( const s16  value) [inline, virtual]

Set the largest value that the slider can represent.

Parameters:
valueThe largest value.

Implements WoopsiUI::SliderBase.

void WoopsiUI::SliderHorizontal::setMinimumValue ( const s16  value) [inline, virtual]

Set the smallest value that the slider can represent.

Parameters:
valueThe smallest value.

Implements WoopsiUI::SliderBase.

void WoopsiUI::SliderHorizontal::setPageSize ( const s16  pageSize) [inline, virtual]

Set the page size represented by the grip.

Parameters:
pageSizeThe page size.
See also:
getPageSize().

Implements WoopsiUI::SliderBase.

void WoopsiUI::SliderHorizontal::setValue ( const s32  value) [virtual]

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

Parameters:
valueThe new value.

Implements WoopsiUI::SliderBase.


Member Data Documentation

Pointer to the grip.

Maximum value that the grip can represent.

Smallest width that the grip can become

Minimum value that the grip can represent.

Value of a page of data, used when clicking the gutter.

Current value of the slider.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Enumerations Enumerator