#include <TextEntry.h>
Inheritance diagram for TextEntry:
Public Types | |
enum | TextEntryType { NORMAL, UPPERCASE, LOWERCASE } |
Public Member Functions | |
TextEntry (const string &label, const string &name, Font *font, TextEntryType type=NORMAL, const string &defaultValue="", int maxLength_=0) | |
void | load (ifstream &file) |
void | save (ofstream &file) |
void | draw (float x, float y, float zoom) |
Type | getType () |
float | getWidth (float zoom) |
float | getHeight (float zoom) |
string & | getName () |
string & | getValue () |
bool | handleKeyEvent (SDL_Event *event) |
Definition at line 15 of file TextEntry.h.
|
Defines the type of TextEntry
Definition at line 19 of file TextEntry.h. |
|
Constructor lable is the name the user can see on screen. name is the name of the TextEntry in the config file. font is the Font to use when rendering. type is the type of the TextEntry. defaultValue is the value to use if no entry is found in the config file or the config file is't loaded. maxLength is the maximal length of the text the user can enter, 0 for unlimited. Currently only 0 is implemented. Definition at line 7 of file TextEntry.cpp. |
|
Draws the MenuItem at x,y with a zoom factor of zoom (2 equals double size). The MenuItem may decide not to apply the scale or to only support some zoom steps, always check getWidth and getHeight if you need the excact size. Implements MenuItem. Definition at line 53 of file TextEntry.cpp. |
|
Returns the height of this MenuItem at zoom factor zoom, must be excact Implements MenuItem. Definition at line 63 of file TextEntry.cpp. |
|
Returns the name of the MenuItem used when save is called. The name may not contain a =. Implements MenuItem. Definition at line 51 of file TextEntry.h. |
|
Returns the Type of this control. Implements MenuItem. Definition at line 48 of file TextEntry.h. |
|
Returns the text string that the user has typed in the TextEntry. Definition at line 53 of file TextEntry.h. |
|
Returns the width of this MenuItem at zoom factor zoom, must be excact Implements MenuItem. Definition at line 58 of file TextEntry.cpp. |
|
Called when a key press/release event occurs, return true if the MenuItem has handled the event. If true is returned the event handling will stop. Implements MenuItem. Definition at line 68 of file TextEntry.cpp. |
|
Reads the configuration for the MenuItem from any position within the file Hint: Use findLoadPosition to find you entry in the file Reimplemented from MenuItem. Definition at line 23 of file TextEntry.cpp. |
|
Saves the MenuItem at the current position in the file. Entrys must look like "name=value\n". Reimplemented from MenuItem. Definition at line 38 of file TextEntry.cpp. |