Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

slider.h

Go to the documentation of this file.
00001 /* ***********************************************************************************
00002         Writer:         Sebastien Bloc
00003         Copyright:      2003-2004
00004         eMail:          sebastien.bloc@free.fr
00005         URL:            http://mignonsoft.free.fr
00006         
00007         This program is free software; you can redistribute it and/or
00008         modify it under the terms of the GNU General Public License
00009         as published by the Free Software Foundation; either version 2
00010         of the License, or (at your option) any later version.
00011 
00012         This program is distributed in the hope that it will be useful,
00013         but WITHOUT ANY WARRANTY; without even the implied warranty of
00014         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015         GNU General Public License for more details.
00016         http://www.gnu.org/copyleft/gpl.html
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         // variable membre
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

Generated on Fri Aug 20 19:19:49 2004 for 3d Controls by doxygen 1.3.6