- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- File List
- File Members

# CSlider.hpp

Go to the documentation of this file.

    00001 #ifndef __CSlider__
    00002 #define __CSlider__
    00003
    00004 #include "CControl.hpp"
    00005 #include "CRolloverButton.hpp"
    00006 #include <MathTools/CBounds.hpp>
    00007
    00008 //  ===========================================================================
    00009
    00010 using Exponent::GUI::Controls::CControl;
    00011 using Exponent::GUI::Controls::CRolloverButton;
    00012 using Exponent::MathTools::CBounds;
    00013
    00014 //  ===========================================================================
    00015
    00016 namespace Exponent
    00017 {
    00018     namespace GUI
    00019     {
    00020         namespace Controls
    00021         {
    00039             class CSlider : public CControl
    00040             {
    00042                 EXPONENT_CLASS_DECLARATION;
    00045 //  ===========================================================================
    00046
    00047             public:
    00048
    00049 //  ===========================================================================
    00050
    00058                 CSlider(IControlRoot *root, const long uniqueId, const CRect &area, IActionListener *listener = NULL);
    00059
    00063                 virtual ~CSlider();
    00064
    00065 //  ===========================================================================
    00066
    00071                 virtual void setValue(const double value);
    00072
    00077                 virtual void drawControl(CGraphics &graphics);
    00078
    00079 //  ===========================================================================
    00080
    00088                 virtual void setSliderImages(IImage *sliderHandle, IImage *sliderOver, IImage *sliderDown, IImage *sliderDisabled);
    00089
    00098                 virtual void setColours(CAlphaColour frameColour, CAlphaColour backgroundColour, CAlphaColour handleColour, CAlphaColour handleOverColour, CAlphaColour handleDownColour);
    00099
    00100 //  ===========================================================================
    00101
    00106                 virtual void handleLeftButtonDown(CMouseEvent &event);
    00107
    00112                 virtual void handleLeftButtonUp(CMouseEvent &event);
    00113
    00118                 virtual void handleMouseScroll(CMouseEvent &event);
    00119
    00124                 virtual void handleMouseMovement(CMouseEvent &event);
    00125
    00130                 virtual void handleMouseLeavingArea(CMouseEvent &event);
    00131
    00132 //  ===========================================================================
    00133
    00134             protected:
    00135
    00136 //  ===========================================================================
    00137
    00143                 virtual bool drawEnabledControl(CGraphics &graphics);
    00144
    00149                 virtual void checkAndLock(const CPoint &point);
    00150
    00151 //  ===========================================================================
    00152
    00153                 IImage *m_sliderHandleImage;
    00154                 IImage *m_sliderOverImage;
    00155                 IImage *m_sliderDownImage;
    00156                 IImage *m_sliderDisabledImage;
    00158                 CRect m_sliderPosition;
    00159                 CPoint m_grabOffset;
    00161                 CRolloverButton::ERolloverState m_state;
    00162                 bool m_isVertical;
    00163                 bool m_isDragging;
    00165                 double m_sliderRange;
    00167                 CAlphaColour m_handleColour;
    00168                 CAlphaColour m_handleOverColour;
    00169                 CAlphaColour m_handleDownColour;
    00171             };
    00172         }
    00173     }
    00174 }
    00175 #endif  // End of CSlider.hpp