Return to Index

TextInput

Parent class: Widget

The TextInput class provides a base class for single line text manipulation widgets. It cannot be instantiated on its own, but its direct descendants TextEntry and PasswordEntry are frequently used in graphical applications.


Object Events:
ChangedAn event generated when the text changes.
ActivatedAn event generated when the Enter key is pressed in the entry.

Method Summary:
void TextInput::setText(const String& pText);
String TextInput::getText();
void TextInput::clear();
int TextInput::getLength();
void TextInput::setCursorPos(int pPos);
int TextInput::getCursorPos();
void TextInput::setMaxLength(int l);
int TextInput::getMaxLength();
void TextInput::select(int pStart, int pEnd);
void TextInput::selectAll();
void TextInput::setEditable(bool pEditable);
bool TextInput::isEditable();
void TextInput::setValue(int v);
void TextInput::setValue(double v, int d);
int TextInput::getIntValue();();
double TextInput::getFloatValue();();



void TextInput::setText
void TextInput::setText(const String& pText);

Sets the text in the entry.
Parameters:
const String& pTextThe text string.

String TextInput::getText
String TextInput::getText();

Returns the text in the entry.

void TextInput::clear
void TextInput::clear();

Removes all the text.

int TextInput::getLength
int TextInput::getLength();

Returns the length of the text stored in the entry.

void TextInput::setCursorPos
void TextInput::setCursorPos(int pPos);

Changes the current insertion position.
Parameters:
int pPosThe new position.

int TextInput::getCursorPos
int TextInput::getCursorPos();

Returns the current insertion position.

void TextInput::setMaxLength
void TextInput::setMaxLength(int l);

Changes the maximum length of an accepted string in the entry.
Parameters:
int lThe new maximum length.

int TextInput::getMaxLength
int TextInput::getMaxLength();

Returns the maximum length of strings accepted.

void TextInput::select
void TextInput::select(int pStart, int pEnd);

Selects the text in the specified range.
Parameters:
int pStartThe starting position.
int pEndThe ending position.

void TextInput::selectAll
void TextInput::selectAll();

Selects all of the text in the editor.

void TextInput::setEditable
void TextInput::setEditable(bool pEditable);

Changes whether the text in the entry is editable.
Parameters:
bool pEditableTo enable editing or not.

bool TextInput::isEditable
bool TextInput::isEditable();

Returns whether the entry is user-editable.

void TextInput::setValue
void TextInput::setValue(int v);

Sets the text to the integer numeric value.
Parameters:
int vThe value.

void TextInput::setValue
void TextInput::setValue(double v, int d);

Sets the text to the double numeric value.
Parameters:
double vThe value.
int dNumber of decimal places. Defaults to 3

int TextInput::getIntValue();
int TextInput::getIntValue();();

Gets the integer value of the text.

double TextInput::getFloatValue();
double TextInput::getFloatValue();();

Gets the double value of the text.


Generated automatically by docgen 0.0.1
© 2003 Aron Dobos