Class MySlider Used to draw an horizontal slider You have two type of sliders : a common slider and a slider which return to origin when released. More...
#include <SDK_Manila_Sense.h>
Inherits Element.
Public Member Functions | |
MySlider (int idElement, int x, int y, int width, bool visible, int minVal=0, int maxVal=100) | |
to create a common slider | |
MySlider (int idElement, int x, int y, int width, bool visible, double lengthAnim) | |
to create a slider which return to origin when released | |
~MySlider (void) | |
void | changeVisibility (int state) |
Method used to change the visibility of slider. | |
int | getValue () |
virtual Element * | isClicked (int x, int y) |
To test if a position is inside the element... | |
int | mouseGesture () |
Method called before each frame to take decision according to user gesture. | |
virtual void | paint (DIRECTDRAW_GDI *lpDDraw, int x, int y) |
To draw the slider... | |
bool | run (bool isRightClicked=false) |
To start action associated with this element. | |
void | unClick () |
To notify the item it is no longer active. | |
void | updatePosition (int newPos=-1) |
To change to position of cursor. | |
Public Attributes | |
int | mySpeed |
Speed of slider when drawing animation. | |
Static Public Attributes | |
static MySlider * | slideRunning = NULL |
When drawing the go back animation, used to know which slider need to repaint. | |
Protected Member Functions | |
void | loadSurf () |
load (or reload) surface | |
Protected Attributes | |
RECT | clipping |
Section * | container |
bool | isSliding |
int | maxVal |
int | minVal |
int | position |
the position relative to other components | |
bool | sliderAnim |
int | state |
Static Protected Attributes | |
static DIRECTDRAW_GDI * | btnSurf = NULL |
static int | heightBtn = 0 |
static int | heightSlide = 0 |
static DIRECTDRAW_GDI * | slideSurf = NULL |
static int | widthBtn = 0 |
static int | widthSlide = 0 |
Class MySlider Used to draw an horizontal slider You have two type of sliders : a common slider and a slider which return to origin when released.
Definition at line 889 of file SDK_Manila_Sense.h.
MySlider::MySlider | ( | int | idElement, | |
int | x, | |||
int | y, | |||
int | width, | |||
bool | visible, | |||
int | minVal = 0 , |
|||
int | maxVal = 100 | |||
) |
to create a common slider
idElement | a number used to identify the Element (Can be used to get a pointer with Element::getElementByID) | |
x | padding left of the element | |
y | padding top of the element | |
width | width of slider | |
visible | true if you want to active the slider. If false, user will not be able to move the cursor | |
minVal | minimum value of slider (when cursor is to the left) | |
maxVal | maximum value of slider (when cursor is to the right) |
Definition at line 41 of file MySlider.cpp.
MySlider::MySlider | ( | int | idElement, | |
int | x, | |||
int | y, | |||
int | width, | |||
bool | visible, | |||
double | lengthAnim | |||
) |
to create a slider which return to origin when released
idElement | a number used to identify the Element (Can be used to get a pointer with Element::getElementByID) | |
x | padding left of the element | |
y | padding top of the element | |
width | width of slider | |
visible | true if you want to active the slider. If false, user will not be able to move the cursor | |
lengthAnim | In milliseconds, the time the slider will take to go back to origin |
Definition at line 70 of file MySlider.cpp.
MySlider::~MySlider | ( | void | ) |
Definition at line 100 of file MySlider.cpp.
void MySlider::changeVisibility | ( | int | state | ) | [inline] |
Method used to change the visibility of slider.
state | on of these values : VIS_SLIDE_NORMAL or VIS_SLIDE_DISABLED |
Definition at line 973 of file SDK_Manila_Sense.h.
int MySlider::getValue | ( | ) | [inline] |
Definition at line 975 of file SDK_Manila_Sense.h.
Element * MySlider::isClicked | ( | int | x, | |
int | y | |||
) | [virtual] |
To test if a position is inside the element...
x | position of click | |
y | position of click |
Implements Element.
Definition at line 133 of file MySlider.cpp.
void MySlider::loadSurf | ( | ) | [protected, virtual] |
int MySlider::mouseGesture | ( | ) | [virtual] |
Method called before each frame to take decision according to user gesture.
Use MouseCtrl::changeMouseAnalyse to capture user gesture.
Reimplemented from Element.
Definition at line 333 of file MySlider.cpp.
void MySlider::paint | ( | DIRECTDRAW_GDI * | lpDDraw, | |
int | x, | |||
int | y | |||
) | [virtual] |
To draw the slider...
lpDDraw | surface to print (GlobalInformations::primaryBuffer for example) | |
x | position of top-left | |
y | position of top-left |
Implements Element.
Definition at line 157 of file MySlider.cpp.
bool MySlider::run | ( | bool | isRightClicked = false |
) | [virtual] |
To start action associated with this element.
isRightClicked | true if your want to start action associated with a right click |
Reimplemented from Element.
Definition at line 104 of file MySlider.cpp.
void MySlider::unClick | ( | ) | [virtual] |
To notify the item it is no longer active.
Reimplemented from Element.
Definition at line 109 of file MySlider.cpp.
void MySlider::updatePosition | ( | int | newPos = -1 |
) |
To change to position of cursor.
newPos | position of cursor (should be between minVal and maxVal) |
Definition at line 354 of file MySlider.cpp.
DIRECTDRAW_GDI * MySlider::btnSurf = NULL [static, protected] |
Definition at line 895 of file SDK_Manila_Sense.h.
RECT MySlider::clipping [protected] |
Definition at line 897 of file SDK_Manila_Sense.h.
Section* MySlider::container [protected] |
Definition at line 902 of file SDK_Manila_Sense.h.
int MySlider::heightBtn = 0 [static, protected] |
Definition at line 901 of file SDK_Manila_Sense.h.
int MySlider::heightSlide = 0 [static, protected] |
Definition at line 899 of file SDK_Manila_Sense.h.
bool MySlider::isSliding [protected] |
Definition at line 908 of file SDK_Manila_Sense.h.
int MySlider::maxVal [protected] |
Definition at line 906 of file SDK_Manila_Sense.h.
int MySlider::minVal [protected] |
Definition at line 906 of file SDK_Manila_Sense.h.
Speed of slider when drawing animation.
Definition at line 977 of file SDK_Manila_Sense.h.
int MySlider::position [protected] |
the position relative to other components
Reimplemented from Element.
Definition at line 905 of file SDK_Manila_Sense.h.
bool MySlider::sliderAnim [protected] |
Definition at line 907 of file SDK_Manila_Sense.h.
MySlider * MySlider::slideRunning = NULL [static] |
When drawing the go back animation, used to know which slider need to repaint.
Definition at line 975 of file SDK_Manila_Sense.h.
DIRECTDRAW_GDI * MySlider::slideSurf = NULL [static, protected] |
Definition at line 894 of file SDK_Manila_Sense.h.
int MySlider::state [protected] |
Definition at line 904 of file SDK_Manila_Sense.h.
int MySlider::widthBtn = 0 [static, protected] |
Definition at line 900 of file SDK_Manila_Sense.h.
int MySlider::widthSlide = 0 [static, protected] |
Definition at line 898 of file SDK_Manila_Sense.h.