00001 #ifndef HEADER_SLIDER_H
00002 #define HEADER_SLIDER_H
00003
00004 #include "IWidget.h"
00005
00006
00007
00008
00009 class Slider : public IWidget {
00010 private:
00011 static const int PIXELS_PER_VALUE = 2;
00012 static const int HEIGHT = 30;
00013 std::string m_param;
00014 int m_min;
00015 int m_max;
00016 private:
00017 int value2slide(int value);
00018 int slide2value(int slide);
00019 virtual void own_mouseButton(const MouseStroke &stroke);
00020 public:
00021 Slider(const std::string ¶m, int minValue=0, int maxValue=100);
00022 virtual int getW() const { return (m_max - m_min) * PIXELS_PER_VALUE; }
00023 virtual int getH() const { return HEIGHT; }
00024
00025 virtual void drawOn(SDL_Surface *screen);
00026 };
00027
00028 #endif