00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef CTRL_RADIALSLIDER_HPP
00026 #define CTRL_RADIALSLIDER_HPP
00027
00028 #include "ctrl_generic.hpp"
00029 #include "../utils/fsm.hpp"
00030 #include "../utils/observer.hpp"
00031
00032
00033 class GenericBitmap;
00034 class OSGraphics;
00035 class VarPercent;
00036
00037
00039 class CtrlRadialSlider: public CtrlGeneric, public Observer<VarPercent>
00040 {
00041 public:
00044 CtrlRadialSlider( intf_thread_t *pIntf, const GenericBitmap &rBmpSeq,
00045 int numImg, VarPercent &rVariable, float minAngle,
00046 float maxAngle, const UString &rHelp,
00047 VarBool *pVisible );
00048
00049 virtual ~CtrlRadialSlider();
00050
00052 virtual void handleEvent( EvtGeneric &rEvent );
00053
00055 virtual bool mouseOver( int x, int y ) const;
00056
00058 virtual void draw( OSGraphics &rImage, int xDest, int yDest );
00059
00061 virtual string getType() const { return "radial_slider"; }
00062
00063 private:
00065 FSM m_fsm;
00067 int m_numImg;
00069 VarPercent &m_rVariable;
00071 float m_minAngle, m_maxAngle;
00073 int m_position;
00075 int m_width, m_height;
00077 EvtGeneric *m_pEvt;
00079 OSGraphics *m_pImgSeq;
00081 int m_lastPos;
00082
00084 DEFINE_CALLBACK( CtrlRadialSlider, UpDown )
00085 DEFINE_CALLBACK( CtrlRadialSlider, DownUp )
00086 DEFINE_CALLBACK( CtrlRadialSlider, Move )
00087
00089 virtual void onUpdate( Subject<VarPercent> &rVariable );
00090
00094 void setCursor( int posX, int posY, bool blocking );
00095 };
00096
00097
00098 #endif