GUITextBox Class Reference

#include <glwx.h>

Inheritance diagram for GUITextBox:

Inheritance graph
[legend]
Collaboration diagram for GUITextBox:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 GUITextBox (const std::string &callback="", const std::string &fieldText="")
virtual void render (float clockTick)
virtual void checkMouseEvents (MouseEvent &evt, int extraInfo, bool reservedBits=false)
virtual void checkKeyboardEvents (KeyEvent &evt, int extraInfo)
virtual bool loadXMLSettings (const TiXmlElement *node)
virtual const Tuple4i & getWindowBounds ()
void setText (const std::string &text)
const std::string & getText () const
bool textChanged ()
void setBordersColor (const Tuple3f &color)
void setBordersColor (float r, float g, float b)
const Tuple3f & getBordersColor () const
void setPadding (const Tuple2i &p)
void setPadding (int x, int y)
const Tuple2i & getPadding () const

Protected Attributes

Tuple2i padding
Tuple3f bordersColor
Tuple3f textColor
float blinkerTimer
size_t blinkerPosition
size_t textStartIndex
size_t textEndIndex
bool blinkerOn

Private Member Functions

void setupText (int type, char info=0)
void setupBlinker (size_t mouseX)


Detailed Description

Definition at line 690 of file glwx.h.


Constructor & Destructor Documentation

GUITextBox::GUITextBox ( const std::string &  callback = "",
const std::string &  fieldText = "" 
)

Definition at line 3 of file GUITextBox.cpp.

References blinkerOn, blinkerPosition, blinkerTimer, GUIRectangle::dimensions, GUIFontManager::getDefaultFont(), GUIFont::getFontObject(), GUIAlphaElement::label, padding, setBordersColor(), GUIAlphaElement::setColor(), GUIRectangle::setDimensions(), setPadding(), GUIText::setString(), textEndIndex, textStartIndex, GUIRectangle::widgetType, and WT_TEXT_BOX.


Member Function Documentation

void GUITextBox::render ( float  clockTick  )  [virtual]

Implements GUIAlphaElement.

Definition at line 70 of file GUITextBox.cpp.

References blinkerOn, blinkerPosition, blinkerTimer, bordersColor, GUIAlphaElement::color, GUIText::getColor(), getWindowBounds(), GUIAlphaElement::label, GUIAlphaElement::modifyCurrentAlpha(), padding, GUIRectangle::parent, GUIText::print(), textEndIndex, textStartIndex, GUIRectangle::visible, and GUIRectangle::windowBounds.

void GUITextBox::checkMouseEvents ( MouseEvent evt,
int  extraInfo,
bool  reservedBits = false 
) [virtual]

Reimplemented from GUIRectangle.

Definition at line 116 of file GUITextBox.cpp.

References blinkerOn, GUIRectangle::checkMouseEvents(), GUIRectangle::clicked, GUIRectangle::focused, MouseEvent::getX(), GUIRectangle::mouseOver, GUIRectangle::pressed, GUIRectangle::released, and setupBlinker().

void GUITextBox::checkKeyboardEvents ( KeyEvent evt,
int  extraInfo 
) [virtual]

Reimplemented from GUIRectangle.

Definition at line 130 of file GUITextBox.cpp.

References GUIRectangle::active, KeyEvent::displayable(), GUIRectangle::focused, GUIText::forceUpdate(), KeyEvent::getKeyChar(), KeyEvent::getKeyID(), GUIText::getString(), KE_PRESSED, GUIAlphaElement::label, setupText(), KeyEvent::setUsed(), TE_BACKSPACE_DELETE, TE_INSERT_CHAR, TE_SIMPLE_DELETE, and GUIRectangle::update.

bool GUITextBox::loadXMLSettings ( const TiXmlElement *  node  )  [virtual]

Reimplemented from GUIAlphaElement.

Definition at line 24 of file GUITextBox.cpp.

References bordersColor, GUIAlphaElement::loadXMLSettings(), setBordersColor(), and Logger::writeErrorLog().

Referenced by GUIPanel::loadXMLSettings().

const Tuple4i & GUITextBox::getWindowBounds (  )  [virtual]

Reimplemented from GUIRectangle.

Definition at line 280 of file GUITextBox.cpp.

References blinkerPosition, GUIText::computeDimensions(), GUIRectangle::computeWindowBounds(), GUIRectangle::dimensions, GUIText::getHeight(), GUIAlphaElement::label, padding, GUIRectangle::parent, setupText(), TE_PARSE_VISIBLE, GUIRectangle::update, and GUIRectangle::windowBounds.

Referenced by render(), and setupBlinker().

void GUITextBox::setText ( const std::string &  text  ) 

const std::string& GUITextBox::getText (  )  const

bool GUITextBox::textChanged (  ) 

void GUITextBox::setBordersColor ( const Tuple3f &  color  ) 

Definition at line 34 of file GUITextBox.cpp.

Referenced by GUITextBox(), and loadXMLSettings().

void GUITextBox::setBordersColor ( float  r,
float  g,
float  b 
)

Definition at line 44 of file GUITextBox.cpp.

References bordersColor.

const Tuple3f & GUITextBox::getBordersColor (  )  const

Definition at line 39 of file GUITextBox.cpp.

References bordersColor.

void GUITextBox::setPadding ( const Tuple2i &  p  ) 

Definition at line 54 of file GUITextBox.cpp.

Referenced by GUITextBox().

void GUITextBox::setPadding ( int  x,
int  y 
)

Definition at line 59 of file GUITextBox.cpp.

References padding.

const Tuple2i & GUITextBox::getPadding (  )  const

Definition at line 65 of file GUITextBox.cpp.

References padding.

void GUITextBox::setupText ( int  type,
char  info = 0 
) [private]

Definition at line 191 of file GUITextBox.cpp.

References blinkerPosition, GUIText::clear(), GUIFontManager::getCharacterWidth(), GUIFontManager::getFont(), GUIText::getFontIndex(), GUIFont::getFontObject(), GUIText::getString(), GUIRectangle::getWidth(), GUIAlphaElement::label, padding, GUIText::setString(), setupBlinker(), start, TE_BACKSPACE_DELETE, TE_INSERT_CHAR, TE_PARSE_VISIBLE, TE_SIMPLE_DELETE, textEndIndex, and GUIRectangle::windowBounds.

Referenced by checkKeyboardEvents(), and getWindowBounds().

void GUITextBox::setupBlinker ( size_t  mouseX  )  [private]

Definition at line 168 of file GUITextBox.cpp.

References GUIRectangle::active, blinkerOn, blinkerPosition, GUIRectangle::focused, GUIFontManager::getFont(), GUIText::getFontIndex(), GUIFont::getFontObject(), GUIText::getString(), getWindowBounds(), GUIAlphaElement::label, and padding.

Referenced by checkMouseEvents(), and setupText().


Member Data Documentation

Tuple2i GUITextBox::padding [protected]

Definition at line 715 of file glwx.h.

Referenced by getPadding(), getWindowBounds(), GUITextBox(), render(), setPadding(), setupBlinker(), and setupText().

Tuple3f GUITextBox::bordersColor [protected]

Definition at line 716 of file glwx.h.

Referenced by getBordersColor(), loadXMLSettings(), render(), and setBordersColor().

Tuple3f GUITextBox::textColor [protected]

Definition at line 716 of file glwx.h.

float GUITextBox::blinkerTimer [protected]

Definition at line 718 of file glwx.h.

Referenced by GUITextBox(), and render().

size_t GUITextBox::blinkerPosition [protected]

Definition at line 719 of file glwx.h.

Referenced by getWindowBounds(), GUITextBox(), render(), setupBlinker(), and setupText().

size_t GUITextBox::textStartIndex [protected]

Definition at line 719 of file glwx.h.

Referenced by GUITextBox(), and render().

size_t GUITextBox::textEndIndex [protected]

Definition at line 719 of file glwx.h.

Referenced by GUITextBox(), render(), and setupText().

bool GUITextBox::blinkerOn [protected]

Definition at line 722 of file glwx.h.

Referenced by checkMouseEvents(), GUITextBox(), render(), and setupBlinker().


The documentation for this class was generated from the following files:
Generated on Wed Dec 5 20:32:03 2007 for GLWX by  doxygen 1.5.3