TextField Class Reference
[Core GUI related classes (widgets)]

#include <textfield.h>

Inheritance diagram for TextField:

ChatInput IntTextField PasswordField

List of all members.


Detailed Description

A text field.

Definition at line 41 of file textfield.h.


Public Member Functions

 TextField (const std::string &text="")
 Constructor, initializes the text field with the given string.
 ~TextField ()
 Destructor.
virtual void draw (gcn::Graphics *graphics)
 Draws the text field.
void drawFrame (gcn::Graphics *graphics)
 Draws the background and border.
void setNumeric (bool numeric)
 Determine whether the field should be numeric or not.
void setRange (int min, int max)
 Set the range on the field if it is numeric.
void keyPressed (gcn::KeyEvent &keyEvent)
 Processes one keypress.
void setMinimum (int min)
 Set the minimum value for a range.
void setMaximum (int max)
 Set the maximum value for a range.
int getValue () const
 Return the value for a numeric field.
void addListener (TextFieldListener *listener)
 Add a listener.

Private Attributes

bool mNumeric
int mMinimum
int mMaximum
TextFieldListenermListener

Static Private Attributes

static int instances = 0
static float mAlpha = 1.0
static ImageRect skin

Constructor & Destructor Documentation

TextField::TextField ( const std::string &  text = ""  ) 

Constructor, initializes the text field with the given string.

Definition at line 43 of file textfield.cpp.

TextField::~TextField (  ) 

Destructor.

Definition at line 78 of file textfield.cpp.


Member Function Documentation

void TextField::draw ( gcn::Graphics *  graphics  )  [virtual]

Draws the text field.

Reimplemented in PasswordField.

Definition at line 86 of file textfield.cpp.

void TextField::drawFrame ( gcn::Graphics *  graphics  ) 

Draws the background and border.

Definition at line 107 of file textfield.cpp.

void TextField::setNumeric ( bool  numeric  ) 

Determine whether the field should be numeric or not.

Definition at line 117 of file textfield.cpp.

void TextField::setRange ( int  min,
int  max 
) [inline]

Set the range on the field if it is numeric.

Reimplemented in IntTextField.

Definition at line 72 of file textfield.h.

void TextField::keyPressed ( gcn::KeyEvent &  keyEvent  ) 

Processes one keypress.

Reimplemented in IntTextField.

Definition at line 149 of file textfield.cpp.

void TextField::setMinimum ( int  min  )  [inline]

Set the minimum value for a range.

Definition at line 82 of file textfield.h.

void TextField::setMaximum ( int  max  )  [inline]

Set the maximum value for a range.

Definition at line 87 of file textfield.h.

int TextField::getValue (  )  const

Return the value for a numeric field.

Definition at line 134 of file textfield.cpp.

void TextField::addListener ( TextFieldListener listener  )  [inline]

Add a listener.

Definition at line 97 of file textfield.h.


Member Data Documentation

int TextField::instances = 0 [static, private]

Definition at line 100 of file textfield.h.

float TextField::mAlpha = 1.0 [static, private]

Definition at line 101 of file textfield.h.

ImageRect TextField::skin [static, private]

Definition at line 102 of file textfield.h.

bool TextField::mNumeric [private]

Definition at line 103 of file textfield.h.

int TextField::mMinimum [private]

Definition at line 104 of file textfield.h.

int TextField::mMaximum [private]

Definition at line 105 of file textfield.h.

Definition at line 106 of file textfield.h.


The documentation for this class was generated from the following files:

Generated on Sun Apr 26 17:30:44 2009 for The Mana World by  doxygen 1.5.5