00001 00002 00003 #ifndef TEXTEDIT_H 00004 #define TEXTEDIT_H 00005 00006 00007 #include "Component.h" 00008 #include "Vector3f.h" 00009 00010 #include <string> 00011 00012 00013 namespace pge { 00014 namespace gui { 00015 00016 00017 class TextEdit : public Component { 00018 00019 00020 public: 00021 //************************************************************************ 00022 // 00023 // Constructor 00024 // 00025 //************************************************************************ 00027 TextEdit(int x, int y, int width, int height); 00028 00029 00030 //************************************************************************ 00031 // 00032 // Destructor 00033 // 00034 //************************************************************************ 00036 virtual ~TextEdit(void); 00037 00038 00039 //************************************************************************ 00040 // 00041 // Functions 00042 // 00043 //************************************************************************ 00044 bool init(void); 00045 void render(void); 00046 void timer(unsigned int delay); 00047 00048 void setText(const std::string &text) { 00049 m_text = text; 00050 } 00051 00052 std::string getText(void) { 00053 return m_text; 00054 } 00055 00056 int getTextSize(void) { 00057 return m_textSize; 00058 } 00059 00060 void setTextSize(int size) { 00061 m_textSize = size; 00062 } 00063 00064 Vector3f getTextColor(void) { 00065 return m_textColor; 00066 } 00067 00068 void setTextColor(const Vector3f &color) { 00069 m_textColor = color; 00070 } 00071 00072 void setBackgroundEnabled(bool background) { 00073 m_backgroundEnabled = background; 00074 } 00075 00076 00077 private: 00078 //************************************************************************ 00079 // 00080 // Variables 00081 // 00082 //************************************************************************ 00083 std::string m_text; 00084 Vector3f m_textColor; 00085 int m_textSize; 00086 bool m_backgroundEnabled; 00087 }; 00088 }; 00089 }; 00090 00091 #endif