00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00023 #ifndef INCLUDE_SLIDER_H
00024 #define INCLUDE_SLIDER_H
00025
00026 #include "control.h"
00027 #include "input.h"
00028
00029 class EventSlider
00030 {
00031 public:
00032 signal3<double,double,double> moving;
00033 };
00034
00035 #define MIN_SIZE_CURSOR 10
00036 #define SIZE_BUTTON 12
00037
00043 class Slider : public Control
00044 {
00045 private:
00046 double maximum;
00047 double minimum;
00048 double curMax;
00049 double curMin;
00050 double stepButton;
00051 BOOL useButtons;
00052 void ConfigFaces(Control *control,Texture *texture);
00053 void ApplyCurrent();
00054 void Init(double min,double max,double curMin,double curMax);
00055 BOOL SetMin(double value);
00056 BOOL SetMax(double value);
00057 BOOL SetCurrent(double min,double max);
00058 BOOL SetCurrent(double delta);
00059 void SetCurrentByPosition(double x);
00060 void SendMoving();
00061
00062 public:
00063
00064 EventSlider onSlidder;
00065 Button btnPlus;
00066 Button btnMinus;
00067 Control cursor;
00068 Control body;
00069 Timer timerAutoButton;
00070
00071 Slider();
00072 ~Slider();
00073
00074 void Create(double depth);
00075
00076 BOOL Step(double step);
00077 void Setup(double min,double max,double current,double size);
00078 BOOL Min(double value);
00079 BOOL Max(double value);
00080 BOOL Current(double min,double max);
00081 BOOL Current(double delta);
00082 void Refresh();
00083
00084 int OnAutoMinus(Timer *);
00085 int OnAutoPlus(Timer *);
00086 int OnButtonsOverOut(Control *,int);
00087 int OnButtonsLMouseUp(StateMouse *,int);
00088 int OnMinusLMouseDown(StateMouse *,int);
00089 int OnPlusLMouseDown(StateMouse *,int);
00090 int OnLMouseDown(StateMouse *mouse,int face);
00091 int OnMouseMove(StateMouse *mouse,int deltaX,int deltaY,int face);
00092
00093 void ToString(MyString &str);
00094 };
00095
00096 #endif