Public Member Functions | |
this (Dialog parent, int id) | |
Constructs a ListBox object to interface a given list box control. | |
this (WindowBase parent, int id, Rect position) | |
Constructs a list box to be created at runtime. | |
this (FrameWindow parent, int id) | |
Constructs a list box to be used as the client pane of a FrameWindow. | |
int | add (cstring s) |
Adds an item to the end of this list, or in its sorted position if the list box has the LBS_SORT style. | |
int | add (int index, cstring s) |
Inserts an item at the given position. | |
int | remove (int index) |
Removes the item at the given position. | |
int | find (cstring s, int startAfter=-1, bool beginsWith=false) |
Finds an item in the list box. | |
void | removeAll () |
Removes all items from the list box. | |
string | item (int index) |
Gets text of an item in the list box. | |
int | findAndSelect (cstring s, int startAfter=-1) |
Finds an item in the list box beginning with a given string, and selects it. | |
Public Properties | |
int | length () |
The number of items in this list box. | |
int | selected () |
The zero-based index of the currently selected item. | |
int | selected (int index) |
The zero-based index of the currently selected item. | |
string | selectedItem () |
The text of the selected item. | |
int | scrollPosition () |
The zero-based index of the uppermost visible item in the list. | |
int | scrollPosition (int pos) |
The zero-based index of the uppermost visible item in the list. | |
uint[] | tabStops (uint[] t) |
The tab stops to use in this list box. | |
uint[] | tabStops (uint t) |
The tab spacing to use in this list box. | |
uint[] | tabStops () |
The tab stops to use in this list box. | |
Protected Member Functions | |
this (WindowBase parent, int id, string text, Rect position, string className="LISTBOX") | |
Constructs a control to be created at runtime. |
It cannot interface a combo box of any kind. For this, use the ComboBox subclass.
smjg.libs.sdwf.control.ListBox.this | ( | Dialog | parent, | |
int | id | |||
) |
Constructs a ListBox object to interface a given list box control.
Reimplemented from smjg.libs.sdwf.control.Control.
Reimplemented in smjg.libs.sdwf.control.ComboBox.
smjg.libs.sdwf.control.ListBox.this | ( | WindowBase | parent, | |
int | id, | |||
Rect | position | |||
) |
smjg.libs.sdwf.control.ListBox.this | ( | FrameWindow | parent, | |
int | id | |||
) |
Constructs a list box to be used as the client pane of a FrameWindow.
parent | the frame window in which this list box will be framed. | |
id | numeric ID that the list box will have. |
smjg.libs.sdwf.control.ListBox.this | ( | WindowBase | parent, | |
int | id, | |||
string | text, | |||
Rect | position, | |||
string | className = "LISTBOX" | |||
) | [protected] |
Constructs a control to be created at runtime.
parent | the window or dialog on which the control will be placed. | |
id | numeric ID that the control will have. | |
text | the control's caption text. | |
position | the position on the parent window where the control will be placed. | |
className | the Windows control class to which the control will belong. The default setting is for static text. |
Reimplemented from smjg.libs.sdwf.control.Control.
int smjg.libs.sdwf.control.ListBox.add | ( | cstring | s | ) |
Adds an item to the end of this list, or in its sorted position if the list box has the LBS_SORT
style.
s | text of item to add. |
Reimplemented in smjg.libs.sdwf.control.ComboBox.
int smjg.libs.sdwf.control.ListBox.add | ( | int | index, | |
cstring | s | |||
) |
Inserts an item at the given position.
Unlike the add(string)
form, this method ignores the LBS.SORT
style.
index | zero-based index at which to add item, or -1 to add to the end of the list. | |
s | text of item to add. |
Reimplemented in smjg.libs.sdwf.control.ComboBox.
int smjg.libs.sdwf.control.ListBox.remove | ( | int | index | ) |
Removes the item at the given position.
index | zero-based index of item to remove from the list. |
Reimplemented in smjg.libs.sdwf.control.ComboBox.
int smjg.libs.sdwf.control.ListBox.find | ( | cstring | s, | |
int | startAfter = -1 , |
|||
bool | beginsWith = false | |||
) |
Finds an item in the list box.
s | string to match. | |
startAfter | zero-based index of item after which to start the search, or -1 to start at the beginning. | |
beginsWith | whether to look for an item merely beginning with s , as opposed to an exact match. |
-1 | if no matching item was found. |
Reimplemented in smjg.libs.sdwf.control.ComboBox.
void smjg.libs.sdwf.control.ListBox.removeAll | ( | ) |
string smjg.libs.sdwf.control.ListBox.item | ( | int | index | ) |
Gets text of an item in the list box.
index | zero-based index of item to inspect. |
Reimplemented in smjg.libs.sdwf.control.ComboBox.
int smjg.libs.sdwf.control.ListBox.findAndSelect | ( | cstring | s, | |
int | startAfter = -1 | |||
) |
Finds an item in the list box beginning with a given string, and selects it.
s | string to match. | |
startAfter | zero-based index of item after which to start the search, or -1 to start at the beginning. |
-1 | if no matching item was found. |
Reimplemented in smjg.libs.sdwf.control.ComboBox.
int smjg.libs.sdwf.control.ListBox.length | ( | ) |
int smjg.libs.sdwf.control.ListBox.selected | ( | ) |
The zero-based index of the currently selected item.
A value of -1 denotes that no item is selected. Note that this can occasionally happen even when an LBN_SELCHANGE or LBN_DBLCLK event occurs.
Reimplemented in smjg.libs.sdwf.control.ComboBox.
int smjg.libs.sdwf.control.ListBox.selected | ( | int | index | ) |
The zero-based index of the currently selected item.
A value of -1 denotes that no item is selected.
Reimplemented in smjg.libs.sdwf.control.ComboBox.
string smjg.libs.sdwf.control.ListBox.selectedItem | ( | ) |
The text of the selected item.
This method is syntactic sugar for item(selected).
int smjg.libs.sdwf.control.ListBox.scrollPosition | ( | ) |
The zero-based index of the uppermost visible item in the list.
Reimplemented in smjg.libs.sdwf.control.ComboBox.
int smjg.libs.sdwf.control.ListBox.scrollPosition | ( | int | pos | ) |
The zero-based index of the uppermost visible item in the list.
If set to an index that would scroll the list beyond the last item, it scrolls to the end of the list.
Reimplemented in smjg.libs.sdwf.control.ComboBox.
uint [] smjg.libs.sdwf.control.ListBox.tabStops | ( | uint[] | t | ) |
The tab stops to use in this list box.
t | array of tab stop positions, in dialog resource units. |
uint [] smjg.libs.sdwf.control.ListBox.tabStops | ( | uint | t | ) |
The tab spacing to use in this list box.
t | the tab interval, in dialog resource units. |
uint [] smjg.libs.sdwf.control.ListBox.tabStops | ( | ) |
The tab stops to use in this list box.