GLWScrollW.h

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////////////
00002 //    Scorched3D (c) 2000-2009
00003 //
00004 //    This file is part of Scorched3D.
00005 //
00006 //    Scorched3D is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    Scorched3D is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with Scorched3D; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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_; // Hidden
00079         GLWButton backButtonBot_; // Hidden
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_)

Generated on Mon Feb 16 15:14:45 2009 for Scorched3D by  doxygen 1.5.3