Return to Index
ListBox
Parent class: Widget
The ListBox widget displays a scrolling list of text lines.
A user can select one line at a time, and the text list can
be manipulated with the standard addition and removal functions.
Object Events:
Selected | An event generated when the user selects an item. The event's getIndex() returns the index of the selection. |
ListBox::ListBox |
ListBox::ListBox();
Constructs a new ListBox widget. |
void ListBox::append |
void ListBox::append(const String& s);
Appends the specified string to the end of the list. |
Parameters: |
const String& | s | The string to append. |
|
void ListBox::prepend |
void ListBox::prepend(const String& s);
Prepends the specified string to the beginning of the list. |
Parameters: |
const String& | s | The string to prepend. |
|
void ListBox::insert |
void ListBox::insert(const String& s, int index);
Inserts a string to a specified location in the list. |
Parameters: |
const String& | s | The string to insert. |
int | index | The insertion index. |
|
void ListBox::remove |
void ListBox::remove(int index);
Removes the string at the given index. If the index is out of range, nothing happens. |
Parameters: |
int | index | The index of the string to remove. |
|
int ListBox::find |
int ListBox::find(const String& s);
Searches the list for a string.
Returns: Returns the index of the first occurence if found, otherwise returns -1. |
Parameters: |
const String& | s | The string to search for. |
|
void ListBox::clear |
void ListBox::clear();
Empties the list box. |
int ListBox::getLength |
int ListBox::getLength();
Returns the number of items in the list. |
String ListBox::getText |
String ListBox::getText(int i);
Returns the text at the specified index. |
Parameters: |
int | i | Specifies which string to return. |
|
void ListBox::setText |
void ListBox::setText(int index, const String& pStr);
Changes the text displayed at the given index. |
Parameters: |
int | index | The index of the item to change. |
const String& | pStr | The new text. |
|
void ListBox::setData |
void ListBox::setData(const StringArray& pStrs);
Clears the list and inserts the items in the string array. |
Parameters: |
const StringArray& | pStrs | The strings. |
|
int ListBox::getSelection |
int ListBox::getSelection();
Returns the index of the currently selected item, or -1 if no item is selected. |
void ListBox::setSelection |
void ListBox::setSelection(int pIndex);
Changes the current selection. |
Parameters: |
int | pIndex | The index of the new selection. If the index is out of the range, nothing happens. |
|
void ListBox::deselect |
void ListBox::deselect();
Unselects any selected items in the list. |
bool ListBox::isLineVisible |
bool ListBox::isLineVisible();
Returns whether the ith line visible. |
void ListBox::setTopLine |
void ListBox::setTopLine(int i);
Scrolls the list box to set the ith element as the top line. |
Parameters: |
int | i | The line index. |
|
int ListBox::getTopLine |
int ListBox::getTopLine();
Returns the index of the current top line visible. |
void ListBox::setMiddleLine |
void ListBox::setMiddleLine(int i);
Scrolls the list box to make the ith line the middle line in the view. |
Parameters: |
int | i | The item's index. |
|
void ListBox::setBottomLine |
void ListBox::setBottomLine(int i);
Scrolls the list box to make the ith line the bottom line in the view. |
Parameters: |
int | i | The item's index. |
|
int ListBox::getScrollPos |
int ListBox::getScrollPos();
Returns the current scroll position as an integer value. |
int ListBox::setScrollPos |
int ListBox::setScrollPos();
Sets the current scroll position. |
Generated automatically by docgen 0.0.1
© 2003 Aron Dobos