#include <textbox.h>
Rectangle shaped area that accepts keypress events and changes its own caption accordingly. If it contains focus, an underscore character is appended. No scrolling (meaning PalmOS style.)
Definition at line 42 of file textbox.h.
Public Member Functions | |
bool | CastEvent (glictEvents evt, void *wparam, long lparam, void *returnvalue) |
Receives click event (to get focus) and keys to manipulate its caption. | |
glictTextbox () | |
void | Paint () |
Renders the element. Should contain call to CPaint(). | |
void | SetAllowedChars (std::string s) |
Used to define which characters are allowed to be typed. If ' ' is ommitted then it's not allowed either. | |
void | SetBGColor (float r, float g, float b, float a) |
void | SetPassProtectCharacter (char asterisk) |
Used to define which character will be used to display instead of regular characters. | |
~glictTextbox () | |
Private Attributes | |
std::string | allowedchr |
glictColor | bgcolor |
char | passprotectchar |
bool glictTextbox::CastEvent | ( | glictEvents | evt, | |
void * | wparam, | |||
long | lparam, | |||
void * | returnvalue | |||
) | [virtual] |
Receives click event (to get focus) and keys to manipulate its caption.
Reimplemented from glictContainer.
Definition at line 119 of file textbox.cpp.
References allowedchr, glictContainer::caption, glictContainer::DefaultCastEvent(), glictContainer::Focus(), glictContainer::GetEnabled(), glictContainer::GetVisible(), GLICT_KEYPRESS, GLICT_MOUSECLICK, GLICT_MOUSEDOWN, GLICT_MOUSEUP, glictContainer::next, glictContainer::SetCaption(), and glictContainer::x.
void glictTextbox::Paint | ( | ) | [virtual] |
Renders the element. Should contain call to CPaint().
(This description applies for the glictContainer::Paint(). If you are reading it for some other class, then its documentation is not written yet for this function.)
In glictContainer class, Paint does nothing except calling SetScissor() and CPaint(). This is because as a widget the container class does not render anything; it serves as a point of divergence for other classes. Other widgets should define their own procedure with these two calls as a minimum.
When writing a widget, put SetScissor() on the beginning of this function, and CPaint() on the end.
Reimplemented from glictContainer.
Definition at line 47 of file textbox.cpp.
References glictColor::a, glictColor::b, bgcolor, glictContainer::caption, glictContainer::CPaint(), glictContainer::fontname, glictContainer::fontsize, glictColor::g, glictSkinner::GetLeftSize(), glictSkinner::GetTopSize(), glictContainer::GetVisible(), glictFontRender(), glictPos::h, glictContainer::height, glictSkinner::Paint(), glictGlobalsClass::PaintRect(), passprotectchar, glictColor::r, glictContainer::SetCaption(), glictGlobalsClass::SetColor(), glictGlobalsClass::textboxSkin, glictGlobalsClass::textboxTextColor, glictGlobalsClass::topFocused, glictGlobalsClass::Translatef(), glictGlobalsClass::translation, glictPos::w, glictContainer::width, glictContainer::x, glictPos::x, glictContainer::y, and glictPos::y.
void glictTextbox::SetAllowedChars | ( | std::string | s | ) |
Used to define which characters are allowed to be typed. If '
' is ommitted then it's not allowed either.
Defines all characters that are allowed to be typed in this textbox.
s | String containing all permitted characters. |
Definition at line 188 of file textbox.cpp.
References allowedchr.
void glictTextbox::SetPassProtectCharacter | ( | char | asterisk | ) |
Used to define which character will be used to display instead of regular characters.
Sets the character that'll be used for password protection.
asterisk | The character that'll be used. If passed a 0, then regular characters will be used. |
Definition at line 175 of file textbox.cpp.
References passprotectchar.