GLWSelectorPart.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(__INCLUDE_GLWSelectorParth_INCLUDE__)
00022 #define __INCLUDE_GLWSelectorParth_INCLUDE__
00023 
00024 #include <GLW/GLWSelector.h>
00025 
00026 class GLWSelectorPart
00027 {
00028 public:
00029         GLWSelectorPart(GLWSelectorI *user,
00030                 int basePosition,
00031                 float x, float y,
00032                 std::list<GLWSelectorEntry> &entries,
00033                 bool transparent,
00034                 GLWSelectorPart *parent,
00035                 int parentPosition);
00036         virtual ~GLWSelectorPart();
00037 
00038         void draw();
00039         void mouseDown(float x, float y, bool &hit);
00040 
00041         // Links the SelectorParts together for popups
00042         GLWSelectorPart *getParent() { return parent_; }
00043         GLWSelectorPart *getChild() { return child_; }
00044         int getParentPosition() { return parentPosition_; }
00045         
00046         float getSelectedHeight() { return selectedHeight_; }
00047         float getSelectedWidth() { return selectedWidth_; }
00048 
00049 protected:
00050         GLWSelectorI *user_;
00051         std::list<GLWSelectorEntry> entries_;
00052         float selectedHeight_, selectedWidth_;
00053         float selectedX_, selectedY_;
00054         float selectedIndent_;
00055         int basePosition_;
00056         bool transparent_;
00057         bool hasSelectedEntry_, hasPopupEntry_;
00058         GLWSelectorPart *parent_; // If this is popup it will have a parent
00059         GLWSelectorPart *child_; // If this has a popup it may have a child
00060         int parentPosition_;
00061 
00062         void calculateDimensions(float x, float y);
00063 
00064 };
00065 
00066 #endif

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