Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
IntTextField Class Reference

TextBox which only accepts numbers as input. More...

#include <inttextfield.h>

Inheritance diagram for IntTextField:
TextField

Public Member Functions

 IntTextField (int def=0)
 Constructor, sets default value.
 
void setRange (int minimum, int maximum)
 Sets the minimum and maximum values of the text box.
 
int getValue ()
 Returns the value in the text box.
 
void reset ()
 Reset the field to the default value.
 
void setValue (int value)
 Set the value of the text box to the specified value.
 
void setDefaultValue (int value)
 Set the default value of the text box to the specified value.
 
void keyPressed (gcn::KeyEvent &event) override
 Responds to key presses.
 
- Public Member Functions inherited from TextField
 TextField (const std::string &text=std::string(), bool loseFocusOnTab=true)
 Constructor, initializes the text field with the given string.
 
void draw (gcn::Graphics *graphics) override
 Draws the text field.
 
void drawFrame (gcn::Graphics *graphics) override
 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) override
 Processes one keypress.
 
void textInput (const TextInput &textInput)
 Handle text input (should possibly be new event in Guichan).
 
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 setAutoComplete (AutoCompleteLister *lister)
 Sets the TextField's source of autocomplete.
 
AutoCompleteListergetAutoComplete () const
 Returns the TextField's source of autocomplete.
 
void setHistory (TextHistory *history)
 Sets the TextField's source of input history.
 
TextHistorygetHistory () const
 Returns the TextField's source of input history.
 

Private Attributes

int mMin
 Minimum value.
 
int mMax
 Maximum value.
 
int mDefault
 Default value.
 
int mValue
 Current value.
 

Additional Inherited Members

- Protected Member Functions inherited from TextField
void drawCaret (gcn::Graphics *graphics, int x) override
 

Detailed Description

TextBox which only accepts numbers as input.

Definition at line 29 of file inttextfield.h.

Constructor & Destructor Documentation

◆ IntTextField()

IntTextField::IntTextField ( int  def = 0)

Constructor, sets default value.

Definition at line 28 of file inttextfield.cpp.

Member Function Documentation

◆ getValue()

int IntTextField::getValue ( )

Returns the value in the text box.

Definition at line 73 of file inttextfield.cpp.

◆ keyPressed()

void IntTextField::keyPressed ( gcn::KeyEvent &  event)
override

Responds to key presses.

Definition at line 35 of file inttextfield.cpp.

◆ reset()

void IntTextField::reset ( )

Reset the field to the default value.

Definition at line 102 of file inttextfield.cpp.

◆ setDefaultValue()

void IntTextField::setDefaultValue ( int  value)

Set the default value of the text box to the specified value.

Definition at line 92 of file inttextfield.cpp.

◆ setRange()

void IntTextField::setRange ( int  minimum,
int  maximum 
)

Sets the minimum and maximum values of the text box.

Definition at line 57 of file inttextfield.cpp.

◆ setValue()

void IntTextField::setValue ( int  value)

Set the value of the text box to the specified value.

Definition at line 78 of file inttextfield.cpp.

Member Data Documentation

◆ mDefault

int IntTextField::mDefault
private

Default value.

Definition at line 70 of file inttextfield.h.

◆ mMax

int IntTextField::mMax
private

Maximum value.

Definition at line 69 of file inttextfield.h.

◆ mMin

int IntTextField::mMin
private

Minimum value.

Definition at line 68 of file inttextfield.h.

◆ mValue

int IntTextField::mValue
private

Current value.

Definition at line 71 of file inttextfield.h.


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