List of all members.
Detailed Description
Base class for all sliding controls.
- Todo:
- Currently only Veritcal type sliders are supported. Horizontal should be pretty straight forward.
- Todo:
- There's a bit of odd behavior when the mouse is dragged passed the slide area. This should be fairly straight forward to fix using the mMouseX and mMouseY values although it requires that this Control respond to onMouseMove() events.
Constructor & Destructor Documentation
| Slider::Slider |
( |
const std::string & |
name, |
|
|
int |
height, |
|
|
SliderType |
type = SLIDER_VERTICAL | |
|
) |
| | |
Member Function Documentation
| void Slider::changePosition |
( |
double |
change |
) |
|
Adds the change amount to the current position.
- Parameters:
-
| change | Amount to change in percent to change the slider's position. Must be between 0.0 1.0. |
| void Slider::constrainThumb |
( |
|
) |
[private] |
| void Slider::drawPlain |
( |
|
) |
[private, virtual] |
| void Slider::drawSkin |
( |
|
) |
[private, virtual] |
| double Slider::getPosition |
( |
|
) |
const |
Gets the current position of the slider as percentage of the length of the slider.
| int Slider::getSlideLength |
( |
|
) |
const |
Returns the number of pixels the slider can move along.
| double Slider::getStepSize |
( |
Uint |
unit = 1 |
) |
const |
Gets the size of a step based on a unit size.
- Parameters:
-
| unit | Size of a step as a measure of pixels. Default unit size is 1 pixel. |
| void Slider::initialize |
( |
|
) |
[private, virtual] |
- Todo:
- I'm not thrilled with the way the slider determines its width. I'd like to go through this code to ensure that 1) it's correct and 2) it's cleaner than it is.
Reimplemented from Control.
| void Slider::logic |
( |
|
) |
[private, virtual] |
| void Slider::onChanged |
( |
Event * |
event |
) |
[private, virtual] |
Called whenever a Control's data changes.
Reimplemented from Control.
| void Slider::onClick |
( |
Event * |
event |
) |
[private, virtual] |
Reset mouse pressed.
Reimplemented from Control.
| void Slider::onDrag |
( |
Event * |
event |
) |
[private, virtual] |
If the mouse is still pressed on the thumbnail and moves, update the thumbnail position.
Reimplemented from Control.
| void Slider::onPressed |
( |
Event * |
event |
) |
[private, virtual] |
| void Slider::onResized |
( |
|
) |
[private, virtual] |
Called whenever a Control changes its size.
Reimplemented from Control.
| void Slider::setPosition |
( |
double |
position |
) |
|
| void Slider::setThumbSize |
( |
Uint |
size |
) |
|
Sets the thumb size in pixels.
- Parameters:
-
| size | Number of pixels to set the size of the Thumb. |
- Note:
- If slider type is
SLIDER_VERTICAL than size will modify height. Otherwise size will modify width.
Member Data Documentation
Mouse X coordinate. Used to prevent odd behavior in the thumb.
Reimplemented from Control.
Mouse X coordinate. Used to prevent odd behavior in the thumb.
Reimplemented from Control.
Area in which the slider is allowed to move. Avoids unnecessary on-the-fly calculations.
Flag to indicate if this control is pressed.
Current location of the Thumb.
Current location of the Thumb.
The documentation for this class was generated from the following files:
- C:/Development/LoM/client/src/Gui/Controls/Slider.h
- C:/Development/LoM/client/src/Gui/Controls/Slider.cpp