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_GLWLABEL_H__75483479_A6F8_45CC_8E83_B517E721211F__INCLUDED_) 00022 #define AFX_GLWLABEL_H__75483479_A6F8_45CC_8E83_B517E721211F__INCLUDED_ 00023 00024 #include <string> 00025 #include <vector> 00026 #include <GLW/GLWidget.h> 00027 #include <common/Vector.h> 00028 #include <lang/LangResource.h> 00029 00030 class GLWLabel : public GLWidget 00031 { 00032 public: 00033 enum LabelFlags 00034 { 00035 eMultiLine = 1 00036 }; 00037 00038 GLWLabel(float x = 0.0f, float y = 0.0f, 00039 const LangString &labelText = LangString(), 00040 float size = 14.0f, 00041 unsigned int flags = 0); 00042 virtual ~GLWLabel(); 00043 00044 virtual float getW() { calcWidth(); return GLWidget::getW(); } 00045 virtual float getH() { calcWidth(); return GLWidget::getH(); } 00046 virtual void draw(); 00047 00048 bool getEmpty() { return labelText_.empty() && labelTexts_.size() == 0; } 00049 00050 void setText(const LangString &text); 00051 void setColor(const Vector &color); 00052 void setSize(float size); 00053 void calcWidth(); 00054 00055 REGISTER_CLASS_HEADER(GLWLabel); 00056 00057 protected: 00058 unsigned int flags_; 00059 LangString labelText_; 00060 std::vector<LangString> labelTexts_; 00061 Vector color_; 00062 float size_; 00063 00064 }; 00065 00066 #endif // !defined(AFX_GLWLABEL_H__75483479_A6F8_45CC_8E83_B517E721211F__INCLUDED_)
1.5.3