CSliderArray.hpp

Go to the documentation of this file.
00001 #ifndef __CSliderArray__
00002 #define __CSliderArray__
00003 
00004 #include "CControl.hpp"
00005 using Exponent::GUI::Controls::CControl;
00006 
00007 //  ===========================================================================
00008 
00009 namespace Exponent
00010 {
00011     namespace GUI
00012     {
00013         namespace Controls
00014         {
00033             class CSliderArray : public CControl
00034             {
00036                 EXPONENT_CLASS_DECLARATION;
00039 //  ===========================================================================
00040 
00041             public:
00042 
00043 //  ===========================================================================
00044 
00045                 // Construction
00046                 CSliderArray(IControlRoot *root, const long uniqueId, const CRect &area, const long widthOfSlider, const long sliderGap, const long numberOfSliders, IActionListener *listener = NULL);
00047 
00051                 virtual ~CSliderArray();
00052 
00053 //  ===========================================================================
00054 
00060                 virtual void setValue(const double value, const long index);
00061 
00067                 virtual double getValue(const long index) const { return m_sliderValues[index]; }
00068 
00073                 virtual long getIndexOfLastMovedSlider() const { return m_lastIndex; }
00074 
00079                 virtual void drawControl(CGraphics &graphics);
00080 
00081 //  ===========================================================================
00082 
00090                 virtual void setColours(CAlphaColour frameColour, CAlphaColour backgroundColour, CAlphaColour handleColour, CAlphaColour handleDownColour);
00091 
00092 //  ===========================================================================
00093 
00098                 virtual void handleLeftButtonDown(CMouseEvent &event);
00099 
00104                 virtual void handleLeftButtonUp(CMouseEvent &event);
00105 
00110                 virtual void handleMouseMovement(CMouseEvent &event);
00111 
00116                 virtual void handleMouseLeavingArea(CMouseEvent &event);
00117 
00118 //  ===========================================================================
00119 
00120             protected:
00121 
00122 //  ===========================================================================
00123 
00128                 void drawSliders(CGraphics &graphics);
00129 
00135                 void createSliders(const long widthOfSlider, const long sliderGap);
00136 
00137 //  ===========================================================================
00138 
00139                 CAlphaColour m_handleColour;                
00140                 CAlphaColour m_handleDownColour;            
00142                 double *m_sliderValues;                     
00143                 long m_numberOfSliders;                     
00144                 CRect *m_sliders;                           
00145                 long m_widthOfSlider;                       
00146                 long m_sliderGap;                           
00148                 bool m_isDragging;                          
00149                 long m_dragIndex;                           
00150                 long m_lastIndex;                           
00151             };
00152         }
00153     }
00154 }
00155 #endif  // End of CSliderArray.hpp

Infinity API - CSliderArray.hpp Source File generated on 7 Mar 2007