Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

pge::gui::TextEdit Class Reference

#include <TextEdit.h>

Inheritance diagram for pge::gui::TextEdit:

Inheritance graph
[legend]
Collaboration diagram for pge::gui::TextEdit:

Collaboration graph
[legend]

Public Member Functions

 TextEdit (int x, int y, int width, int height)
 Constructor.

virtual ~TextEdit (void)
 Destructor.

bool init (void)
void render (void)
 Called when the object should render itself.

void timer (unsigned int delay)
 Called when the timer event comes.

void setText (const std::string &text)
std::string getText (void)
int getTextSize (void)
void setTextSize (int size)
Vector3f getTextColor (void)
void setTextColor (const Vector3f &color)
void setBackgroundEnabled (bool background)

Private Attributes

std::string m_text
Vector3f m_textColor
int m_textSize
bool m_backgroundEnabled

Constructor & Destructor Documentation

pge::gui::TextEdit::TextEdit int  x,
int  y,
int  width,
int  height
 

Constructor.

Definition at line 17 of file TextEdit.cpp.

References m_backgroundEnabled, m_text, m_textColor, and m_textSize.

00017                                                                       : Component(x, y, width, height) {
00018                         m_text = std::string("");
00019                         m_textColor = Vector3f(1.0f, 1.0f, 1.0f);
00020                         m_textSize = 15;
00021                         m_backgroundEnabled = false;
00022                 }

pge::gui::TextEdit::~TextEdit void   )  [virtual]
 

Destructor.

Definition at line 30 of file TextEdit.cpp.

00030                                         {
00031                 }


Member Function Documentation

std::string pge::gui::TextEdit::getText void   )  [inline]
 

Definition at line 52 of file TextEdit.h.

References m_text.

Referenced by pge::gui::Console::keyTypeCall().

00052                                                 {
00053                                 return m_text;
00054                         }

Vector3f pge::gui::TextEdit::getTextColor void   )  [inline]
 

Definition at line 64 of file TextEdit.h.

References m_textColor.

00064                                                     {
00065                                 return m_textColor;
00066                         }

int pge::gui::TextEdit::getTextSize void   )  [inline]
 

Definition at line 56 of file TextEdit.h.

References m_textSize.

00056                                               {
00057                                 return m_textSize;
00058                         }

bool pge::gui::TextEdit::init void   )  [virtual]
 

Implements pge::IRenderableObject.

Definition at line 39 of file TextEdit.cpp.

00039                                         {
00040                         return true;
00041                 }

void pge::gui::TextEdit::render void   )  [virtual]
 

Called when the object should render itself.

Reimplemented from pge::gui::Component.

Definition at line 49 of file TextEdit.cpp.

References pge::gui::Component::getPosition(), m_backgroundEnabled, m_text, and m_textSize.

Referenced by pge::gui::SceneAnalyseGUI::render(), and pge::gui::Console::render().

00049                                           {
00050                         if(m_backgroundEnabled) {
00051                                 // Render background by super class
00052                                 Component::render();
00053                         }
00054 
00055                         // Render text.
00056                         FontRenderer::getInstance()->renderString(m_text, m_textSize, getPosition().m_v[0], getPosition().m_v[1]);
00057                 }

Here is the call graph for this function:

void pge::gui::TextEdit::setBackgroundEnabled bool  background  )  [inline]
 

Definition at line 72 of file TextEdit.h.

References m_backgroundEnabled.

Referenced by pge::gui::Console::Console(), and pge::gui::SceneAnalyseGUI::SceneAnalyseGUI().

00072                                                                    {
00073                                 m_backgroundEnabled = background;
00074                         }

void pge::gui::TextEdit::setText const std::string &  text  )  [inline]
 

Definition at line 48 of file TextEdit.h.

References m_text.

Referenced by pge::gui::Console::keyTypeCall(), pge::gui::SceneAnalyseGUI::render(), and pge::gui::SceneAnalyseGUI::SceneAnalyseGUI().

00048                                                             {
00049                                 m_text = text;
00050                         }

void pge::gui::TextEdit::setTextColor const Vector3f color  )  [inline]
 

Definition at line 68 of file TextEdit.h.

References m_textColor.

00068                                                                  {
00069                                 m_textColor = color;
00070                         }

void pge::gui::TextEdit::setTextSize int  size  )  [inline]
 

Definition at line 60 of file TextEdit.h.

References m_textSize.

00060                                                    {
00061                                 m_textSize = size;
00062                         }

void pge::gui::TextEdit::timer unsigned int  delay  )  [virtual]
 

Called when the timer event comes.

Implements pge::IRenderableObject.

Definition at line 65 of file TextEdit.cpp.

00065                                                        {
00066                 }


Field Documentation

bool pge::gui::TextEdit::m_backgroundEnabled [private]
 

Definition at line 86 of file TextEdit.h.

Referenced by render(), setBackgroundEnabled(), and TextEdit().

std::string pge::gui::TextEdit::m_text [private]
 

Definition at line 83 of file TextEdit.h.

Referenced by getText(), render(), setText(), and TextEdit().

Vector3f pge::gui::TextEdit::m_textColor [private]
 

Definition at line 84 of file TextEdit.h.

Referenced by getTextColor(), setTextColor(), and TextEdit().

int pge::gui::TextEdit::m_textSize [private]
 

Definition at line 85 of file TextEdit.h.

Referenced by getTextSize(), render(), setTextSize(), and TextEdit().


The documentation for this class was generated from the following files:
Generated on Mon Oct 16 12:10:00 2006 for Phobosengine by doxygen 1.3.4