Home ||
Architecture ||
Video Search ||
Visual Search ||
Scripts ||
Applications ||
Important Messages ||
OGL ||
Src
OglGui::TextField Class Reference
basic text input control
More...
#include <TextField.h>
Inheritance diagram for OglGui::TextField:
[legend]Collaboration diagram for OglGui::TextField:
[legend]List of all members.
|
Public Member Functions |
| TextField (Window *parent, int w, int h, strconst text) |
| TextField (Window *parent, int x, int y, int w, int h, strconst text) |
void | SetTextFieldListener (TextFieldListener *listener, void *userData=0) |
virtual void | DisplayFunc () |
virtual void | DrawTextWithCursor () |
virtual void | KeyboardFunc (int c, int state) |
void | ResetCaret () |
void | SetText (strconst text) |
Protected Member Functions |
void | DeleteSelection () |
void | GetSelectionLeftRight (int &left, int &right) |
void | Init (strconst text) |
Protected Attributes |
TextFieldListener * | mListener |
void * | mListenerData |
int | mCaretPosition |
int | mMarkerPosition |
Detailed Description
basic text input control
This is a text box on screen that can be used for text input. Unfortunatly not all standard textbox functionality is imlemented (yet)
Implementation details: To make the caret work the following system is used:
- 2 member variables store the state: mCaretPosition and mMarkerPosition
- mCaretPosition is always the position the user controls
- the selection spans from the one to the other
- when SHIFT+... is pressed the markerpos doesn't move thus changing the selection size
- typing or deleting behaviour depends on whether there is a selection:
- if there is one, it is deleted
- otherwise the caret pos is used for the operation
- for drawing and deleting one need to know the relative order of the 2 vars, for this the function GetSelectionLeftRight() is created
- drawing uses the following procedure:
- you first draw the string before the selection (can be empty)
- store the current pos (glRasterPos) as the start of the selection
- draw the string inside the selection (can be empty)
- store the current pos as the end of the selection
- draw the string after the selection (can be empty)
- then invert the colors in the selection (if there is no selection invert colors in a 2 pixel wide caret)
Definition at line 45 of file TextField.h.
The documentation for this class was generated from the following file:
Generated on Fri Mar 19 12:08:25 2010 for ImpalaSrc by
1.5.1