Crazy Eddie's GUI System
0.8.4
|
Base class for Slider widgets. More...
Public Member Functions | |
float | getCurrentValue (void) const |
return the current slider value. | |
float | getMaxValue (void) const |
return the maximum value set for this widget | |
float | getClickStep (void) const |
return the current click step setting for the slider. | |
Thumb * | getThumb () const |
Return a pointer to the Thumb component widget for this Slider. | |
virtual void | initialiseComponents (void) |
Initialises the Window based object ready for use. | |
void | setMaxValue (float maxVal) |
set the maximum value for the slider. Note that the minimum value is fixed at 0. | |
void | setCurrentValue (float value) |
set the current slider value. | |
void | setClickStep (float step) |
set the current click step setting for the slider. | |
Slider (const String &type, const String &name) | |
Slider base class constructor. | |
virtual | ~Slider (void) |
Slider base class destructor. | |
Static Public Attributes | |
static const String | EventNamespace |
Namespace for global events. | |
static const String | WidgetTypeName |
Window factory name. | |
static const String | EventValueChanged |
static const String | EventThumbTrackStarted |
static const String | EventThumbTrackEnded |
static const String | ThumbName |
Widget name for the thumb component. | |
Protected Member Functions | |
virtual void | updateThumb (void) |
update the size and location of the thumb to properly represent the current state of the slider | |
virtual float | getValueFromThumb (void) const |
return value that best represents current slider value given the current location of the thumb. | |
virtual float | getAdjustDirectionFromPoint (const Vector2f &pt) const |
Given window location pt, return a value indicating what change should be made to the slider. | |
bool | handleThumbMoved (const EventArgs &e) |
update the size and location of the thumb to properly represent the current state of the slider | |
bool | handleThumbTrackStarted (const EventArgs &e) |
handler function for when thumb tracking begins | |
bool | handleThumbTrackEnded (const EventArgs &e) |
handler function for when thumb tracking begins | |
virtual bool | validateWindowRenderer (const WindowRenderer *renderer) const |
Function used in checking if a WindowRenderer is valid for this window. | |
virtual void | onValueChanged (WindowEventArgs &e) |
Handler triggered when the slider value changes. | |
virtual void | onThumbTrackStarted (WindowEventArgs &e) |
Handler triggered when the user begins to drag the slider thumb. | |
virtual void | onThumbTrackEnded (WindowEventArgs &e) |
Handler triggered when the slider thumb is released. | |
virtual void | onMouseButtonDown (MouseEventArgs &e) |
Handler called when a mouse button has been depressed within this window's area. | |
virtual void | onMouseWheel (MouseEventArgs &e) |
Handler called when the mouse wheel (z-axis) position changes within this window's area. | |
Protected Attributes | |
float | d_value |
current slider value | |
float | d_maxValue |
slider maximum value (minimum is fixed at 0) | |
float | d_step |
amount to adjust slider by when clicked (and not dragged). |
Base class for Slider widgets.
The slider widget has a default range of 0.0f - 1.0f. This enables use of the slider value to scale any value needed by way of a simple multiplication.
virtual float CEGUI::Slider::getAdjustDirectionFromPoint | ( | const Vector2f & | pt | ) | const [protected, virtual] |
Given window location pt, return a value indicating what change should be made to the slider.
pt | Point object describing a pixel position in window space. |
float CEGUI::Slider::getClickStep | ( | void | ) | const [inline] |
return the current click step setting for the slider.
The click step size is the amount the slider value will be adjusted when the widget is clicked wither side of the slider thumb.
float CEGUI::Slider::getCurrentValue | ( | void | ) | const [inline] |
return the current slider value.
float CEGUI::Slider::getMaxValue | ( | void | ) | const [inline] |
return the maximum value set for this widget
Thumb* CEGUI::Slider::getThumb | ( | ) | const |
Return a pointer to the Thumb component widget for this Slider.
UnknownObjectException | Thrown if the Thumb component does not exist. |
virtual float CEGUI::Slider::getValueFromThumb | ( | void | ) | const [protected, virtual] |
return value that best represents current slider value given the current location of the thumb.
bool CEGUI::Slider::handleThumbMoved | ( | const EventArgs & | e | ) | [protected] |
update the size and location of the thumb to properly represent the current state of the slider
return value that best represents current slider value given the current location of the thumb.
Given window location pt, return a value indicating what change should be made to the slider.
pt | Point object describing a pixel position in window space. |
handler function for when thumb moves.
virtual void CEGUI::Slider::initialiseComponents | ( | void | ) | [virtual] |
Initialises the Window based object ready for use.
Reimplemented from CEGUI::Window.
virtual void CEGUI::Slider::onMouseButtonDown | ( | MouseEventArgs & | e | ) | [protected, virtual] |
Handler called when a mouse button has been depressed within this window's area.
e | MouseEventArgs object. All fields are valid. |
Reimplemented from CEGUI::Window.
virtual void CEGUI::Slider::onMouseWheel | ( | MouseEventArgs & | e | ) | [protected, virtual] |
Handler called when the mouse wheel (z-axis) position changes within this window's area.
e | MouseEventArgs object. All fields are valid. |
Reimplemented from CEGUI::Window.
void CEGUI::Slider::setClickStep | ( | float | step | ) | [inline] |
set the current click step setting for the slider.
The click step size is the amount the slider value will be adjusted when the widget is clicked wither side of the slider thumb.
step | float value representing the click step setting to use. |
void CEGUI::Slider::setCurrentValue | ( | float | value | ) |
set the current slider value.
value | float value specifying the new value for this slider widget. |
void CEGUI::Slider::setMaxValue | ( | float | maxVal | ) |
set the maximum value for the slider. Note that the minimum value is fixed at 0.
maxVal | float value specifying the maximum value for this slider widget. |
virtual bool CEGUI::Slider::validateWindowRenderer | ( | const WindowRenderer * | renderer | ) | const [protected, virtual] |
Function used in checking if a WindowRenderer is valid for this window.
renderer | Window renderer that will be checked (it can be null!) |
Reimplemented from CEGUI::Window.
const String CEGUI::Slider::EventThumbTrackEnded [static] |
Event fired when the user releases the thumb. Handlers are passed a const WindowEventArgs reference with WindowEventArgs::window set to the Slider whose thumb has been released.
const String CEGUI::Slider::EventThumbTrackStarted [static] |
Event fired when the user begins dragging the thumb. Handlers are passed a const WindowEventArgs reference with WindowEventArgs::window set to the Slider whose thumb has started to be dragged.
const String CEGUI::Slider::EventValueChanged [static] |
Event fired when the slider value changes. Handlers are passed a const WindowEventArgs reference with WindowEventArgs::window set to the Slider whose value has changed.