#include <slidervertical.h>
Public Member Functions | |
SliderVertical (s16 x, s16 y, u16 width, u16 height) | |
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 | handleDragEvent (const GadgetEventArgs &e) |
s16 | getMinimumStep () const |
Protected Member Functions | |
s32 | getPhysicalMaximumValueWithBitshift () const |
const s32 | getGripValue () const |
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 | ~SliderVertical () |
SliderVertical (const SliderVertical &sliderVertical) | |
void | resizeGrip () |
Protected Attributes | |
SliderVerticalGrip * | _grip |
s16 | _minimumValue |
s16 | _maximumValue |
s32 | _value |
s16 | _minimumGripHeight |
s16 | _pageSize |
s32 | _gutterHeight |
u32 | _contentSize |
Gadget providing a sliding "grip" that can be moved up and down the "gutter". Essentially a scrollbar, but more generic.
WoopsiUI::SliderVertical::SliderVertical | ( | s16 | x, | |
s16 | y, | |||
u16 | width, | |||
u16 | height | |||
) |
Constructor.
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. |
virtual WoopsiUI::SliderVertical::~SliderVertical | ( | ) | [inline, protected, virtual] |
Destructor.
WoopsiUI::SliderVertical::SliderVertical | ( | const SliderVertical & | sliderVertical | ) | [inline, protected] |
Copy constructor is protected to prevent usage.
virtual void WoopsiUI::SliderVertical::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.
port | The GraphicsPort to draw to. |
Reimplemented from WoopsiUI::Gadget.
virtual void WoopsiUI::SliderVertical::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.
port | The GraphicsPort to draw to. |
Reimplemented from WoopsiUI::Gadget.
const s32 WoopsiUI::SliderVertical::getGripValue | ( | ) | const [protected] |
Get the value represented by the top of the grip. The value is bitshifted left 16 places for accuracy. return The value represented by the top of the grip.
const s16 WoopsiUI::SliderVertical::getMaximumValue | ( | ) | const [inline, virtual] |
Get the largest value that the slider can represent.
Implements WoopsiUI::SliderBase.
s16 WoopsiUI::SliderVertical::getMinimumStep | ( | ) | const |
Get the smallest value that the slider can move through when dragged.
const s16 WoopsiUI::SliderVertical::getMinimumValue | ( | ) | const [inline, virtual] |
Get the smallest value that the slider can represent.
Implements WoopsiUI::SliderBase.
const s16 WoopsiUI::SliderVertical::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.
Implements WoopsiUI::SliderBase.
s32 WoopsiUI::SliderVertical::getPhysicalMaximumValueWithBitshift | ( | ) | const [protected] |
Get the maximum possible value that the slider can represent. Useful when using the slider as a scrollbar, as the height of the grip prevents the full range of values being accessed (intentionally). The returned value is bitshfted left 16 places for more accuracy in fixed-point calculations.
const s16 WoopsiUI::SliderVertical::getValue | ( | ) | const [inline, virtual] |
Get the current value of the slider. return The current slider value.
Implements WoopsiUI::SliderBase.
virtual void WoopsiUI::SliderVertical::handleDragEvent | ( | const GadgetEventArgs & | e | ) | [virtual] |
Process events fired by the grip.
e | The event details. |
Reimplemented from WoopsiUI::GadgetEventHandler.
virtual void WoopsiUI::SliderVertical::onClick | ( | s16 | x, | |
s16 | y | |||
) | [protected, virtual] |
Moves the grip towards the stylus.
x | The x co-ordinate of the click. | |
y | The y co-ordinate of the click. |
Reimplemented from WoopsiUI::Gadget.
virtual void WoopsiUI::SliderVertical::onResize | ( | u16 | width, | |
u16 | height | |||
) | [protected, virtual] |
Resize the slider to the new dimensions.
width | The new width. | |
height | The new height. |
Reimplemented from WoopsiUI::Gadget.
void WoopsiUI::SliderVertical::resizeGrip | ( | ) | [protected] |
Resize and redraw the grip.
void WoopsiUI::SliderVertical::setMaximumValue | ( | const s16 | value | ) | [inline, virtual] |
Set the largest value that the slider can represent.
value | The largest value. |
Implements WoopsiUI::SliderBase.
void WoopsiUI::SliderVertical::setMinimumValue | ( | const s16 | value | ) | [inline, virtual] |
Set the smallest value that the slider can represent.
value | The smallest value. |
Implements WoopsiUI::SliderBase.
void WoopsiUI::SliderVertical::setPageSize | ( | const s16 | pageSize | ) | [inline, virtual] |
Set the page size represented by the grip.
pageSize | The page size. |
Implements WoopsiUI::SliderBase.
void WoopsiUI::SliderVertical::setValue | ( | const s16 | value | ) | [virtual] |
Set the value that of the slider. This will reposition and redraw the grip.
value | The new value. |
Implements WoopsiUI::SliderBase.
void WoopsiUI::SliderVertical::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.
value | The new value. |
Implements WoopsiUI::SliderBase.
u32 WoopsiUI::SliderVertical::_contentSize [protected] |
Number of values in the min/max range.
SliderVerticalGrip* WoopsiUI::SliderVertical::_grip [protected] |
Pointer to the grip.
s32 WoopsiUI::SliderVertical::_gutterHeight [protected] |
Height of the gutter, taking into account any adjustments made to the height of the grip.
s16 WoopsiUI::SliderVertical::_maximumValue [protected] |
Maximum value that the grip can represent.
s16 WoopsiUI::SliderVertical::_minimumGripHeight [protected] |
Smallest height that the grip can become.
s16 WoopsiUI::SliderVertical::_minimumValue [protected] |
Minimum value that the grip can represent.
s16 WoopsiUI::SliderVertical::_pageSize [protected] |
Value of a page of data, used when clicking the gutter
s32 WoopsiUI::SliderVertical::_value [protected] |
Current value of the slider.