hollyhock
Loading...
Searching...
No Matches
GUITextBox Class Reference
Inheritance diagram for GUITextBox:
Collaboration diagram for GUITextBox:

Public Types

enum  Flag { FlagDrawBox = 1 << 3 , FlagEditable = 1 << 8 }

Public Member Functions

 GUITextBox (int x, int y, int width, int maxLength, bool countLengthByBytes)
 GUITextBox (int x, int y, int width, const char *text, int maxLength, bool countLengthByBytes)
const char * GetText ()
void SetText (const char *text)
Public Member Functions inherited from Wrapped
template<typename T>
T * GetWrapped ()

Additional Inherited Members

Protected Member Functions inherited from Wrapped
 Wrapped (Wrapped const &)=delete
void operator= (Wrapped const &)=delete
Protected Attributes inherited from Wrapped
void * m_wrapped
 A pointer to the wrapped class.

Member Enumeration Documentation

◆ Flag

Enumerator
FlagDrawBox 

Enables drawing the text box's outline and background.

FlagEditable 

Allows the contents of the text box to be modified.

Constructor & Destructor Documentation

◆ GUITextBox() [1/2]

GUITextBox::GUITextBox ( int x,
int y,
int width,
int maxLength,
bool countLengthByBytes )

Creates a text box.

With an example value for the parameter maxLength of 4, the behaviour of countLengthByBytes is as follows:

  • If true, 4 bytes worth of text can be written in the text box. This may be two 2-byte characters, one 2-byte character and two 1-byte characters, etc.
  • If false, 4 characters worth of text can be written in the text box. This may be four 2-byte characters, one 2-byte character and three 1-byte characters, etc.
Parameters
x,yThe position to place the text box at, in pixels and relative to the top left of the display.
widthThe width of the textbox, in pixels.
maxLengthThe maximum number of characters/bytes the text box should hold.
countLengthByBytesTrue if maxLength specifies the maximum number of bytes, and false if it specifies the maximum number of characters.

◆ GUITextBox() [2/2]

GUITextBox::GUITextBox ( int x,
int y,
int width,
const char * text,
int maxLength,
bool countLengthByBytes )

Creates a text box.

With an example value for the parameter maxLength of 4, the behaviour of countLengthByBytes is as follows:

  • If true, 4 bytes worth of text can be written in the text box. This may be two 2-byte characters, one 2-byte character and two 1-byte characters, etc.
  • If false, 4 characters worth of text can be written in the text box. This may be four 2-byte characters, one 2-byte character and three 1-byte characters, etc.
Parameters
x,yThe position to place the text box at, in pixels and relative to the top left of the display.
widthThe width of the textbox, in pixels.
[in]textA string to pre-populate the text box with, or 0 if the textbox should be initially empty.
maxLengthThe maximum number of characters/bytes the text box should hold.
countLengthByBytesTrue if maxLength specifies the maximum number of bytes, and false if it specifies the maximum number of characters.

Member Function Documentation

◆ GetText()

const char * GUITextBox::GetText ( )

Retrieves the text box's current text content.

Returns
The text box's text, or 0 if the text box is empty.

◆ SetText()

void GUITextBox::SetText ( const char * text)

Sets the text box's text.

If the text specified is longer than the maximum string length permitted by the textbox, it is truncated to fit.

Parameters
[in]textThe new string for the textbox.

The documentation for this class was generated from the following files: