glictTextbox Class Reference

#include <textbox.h>

Inheritance diagram for glictTextbox:

glictContainer

List of all members.


Detailed Description

Rectangle shaped area that accepts keypress events and changes its own caption accordingly.

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.)

Todo:
If textcursor goes out of bounds of textbox, scroll the text appropriatelly to follow the cursor

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

Member Function Documentation

bool glictTextbox::CastEvent ( glictEvents  evt,
void *  wparam,
long  lparam,
void *  returnvalue 
) [virtual]

Receives click event (to get focus) and keys to manipulate its caption.

Todo:
Document me!

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.

See also:
SetScissor(), CPaint()

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.

Parameters:
s String containing all permitted characters.
This string is treated as an array of characters which are permitted to be used. If a character does not appear in this list, it will have no effect on the textbox when punched in. If the string is empty, then all characters are permitted.

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.

Parameters:
asterisk The character that'll be used. If passed a 0, then regular characters will be used.
Sets the character that'll be used in place of regular characters that are actually stored within the textbox.

Definition at line 175 of file textbox.cpp.

References passprotectchar.


The documentation for this class was generated from the following files:
SourceForge.net Logo
generated with doxygen 1.5.3 on Mon Oct 29 18:09:27 2007