Mana
|
TextBox which only accepts numbers as input. More...
#include <inttextfield.h>
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. | |
![]() | |
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. | |
AutoCompleteLister * | getAutoComplete () const |
Returns the TextField's source of autocomplete. | |
void | setHistory (TextHistory *history) |
Sets the TextField's source of input history. | |
TextHistory * | getHistory () 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 | |
![]() | |
void | drawCaret (gcn::Graphics *graphics, int x) override |
TextBox which only accepts numbers as input.
Definition at line 29 of file inttextfield.h.
IntTextField::IntTextField | ( | int | def = 0 | ) |
Constructor, sets default value.
Definition at line 28 of file inttextfield.cpp.
int IntTextField::getValue | ( | ) |
Returns the value in the text box.
Definition at line 73 of file inttextfield.cpp.
|
override |
Responds to key presses.
Definition at line 35 of file inttextfield.cpp.
void IntTextField::reset | ( | ) |
Reset the field to the default value.
Definition at line 102 of file inttextfield.cpp.
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.
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.
void IntTextField::setValue | ( | int | value | ) |
Set the value of the text box to the specified value.
Definition at line 78 of file inttextfield.cpp.
|
private |
Default value.
Definition at line 70 of file inttextfield.h.
|
private |
Maximum value.
Definition at line 69 of file inttextfield.h.
|
private |
Minimum value.
Definition at line 68 of file inttextfield.h.
|
private |
Current value.
Definition at line 71 of file inttextfield.h.