00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(AFX_GLWSCROLLW_H__DCD17624_BF31_45DD_8766_2710AB9FFC6D__INCLUDED_)
00022 #define AFX_GLWSCROLLW_H__DCD17624_BF31_45DD_8766_2710AB9FFC6D__INCLUDED_
00023
00024 #include <GLW/GLWScrollButton.h>
00025
00026 class GLWScrollWI
00027 {
00028 public:
00029 virtual ~GLWScrollWI();
00030
00031 virtual void positionChange(unsigned int id, int current, int movement) = 0;
00032 };
00033
00034 class GLWScrollW :
00035 public GLWidget,
00036 public GLWButtonI,
00037 public GLWScrollButtonI
00038 {
00039 public:
00040 GLWScrollW(float x = 0.0f, float y = 0.0f,
00041 float h = 0.0f,
00042 int min = 0, int max = 0, int see = 1,
00043 GLWScrollWI *handler = 0);
00044 virtual ~GLWScrollW();
00045
00046 virtual void setHandler(GLWScrollWI *handler = 0) { handler_ = handler; }
00047 void setMin(int min) { min_ = min; }
00048 void setMax(int max) { max_ = max; }
00049 void setSee(int see) { see_ = see; }
00050 virtual void setCurrent(int c);
00051
00052 virtual void setX(float x);
00053 virtual void setY(float y);
00054 virtual void setW(float w);
00055 virtual void setH(float h);
00056
00057 virtual int getCurrent() { return current_; }
00058 int getMin() { return min_; }
00059 int getMax() { return max_; }
00060 int getSee() { return see_; }
00061
00062 virtual void draw();
00063 virtual void simulate(float frameTime);
00064 virtual void mouseDown(int button, float x, float y, bool &skipRest);
00065 virtual void mouseUp(int button, float x, float y, bool &skipRest);
00066 virtual void mouseDrag(int button, float mx, float my, float x, float y, bool &skipRest);
00067 virtual void buttonDown(unsigned int id);
00068 virtual void mouseWheel(float x, float y, float z, bool &skipRest);
00069
00070 virtual void startDrag(unsigned int id);
00071 virtual void buttonDrag(unsigned int id, float x, float y);
00072
00073 REGISTER_CLASS_HEADER(GLWScrollW);
00074 protected:
00075 GLWScrollWI *handler_;
00076 GLWButton topButton_;
00077 GLWButton bottomButton_;
00078 GLWButton backButtonTop_;
00079 GLWButton backButtonBot_;
00080 GLWScrollButton middleButton_;
00081 int min_, max_, see_;
00082 int current_;
00083 int dragCurrent_;
00084
00085 };
00086
00087
00088 #endif // !defined(AFX_GLWSCROLLW_H__DCD17624_BF31_45DD_8766_2710AB9FFC6D__INCLUDED_)