The OpenD Programming Language

ComboBox

A combination of free entry with a list below it.

class ComboBox : ComboboxBase {
version(custom_widgets)
LineEdit lineEdit;
version(custom_widgets)
ListWidget listWidget;
}

Inherited Members

From ComboboxBase

options
string[] options [@property getter]

Returns the current list of options in the selection.

options
string[] options [@property setter]

Replaces the list of options in the box. Note that calling this will also reset the selection.

addOption
void addOption(string s)

Adds an option to the end of options array.

getSelection
int getSelection()

Gets the current selection as an index into the options array. Returns -1 if nothing is selected.

getSelectionString
string getSelectionString()

Returns the current selection as a string.

setSelection
int setSelection(int idx)
int setSelection(string s)

Sets the current selection to an index in the options array, or to the given option if present. Please note that the string version may do a linear lookup.

SelectionChangedEvent
class SelectionChangedEvent

This event is fired when the selection changes. Both Event.stringValue and Event.intValue are filled in - stringValue is the text in the selection and intValue is the index of the selection. If the combo box allows multiple selection, these values will include only one of the selected items - for those, you should loop through the values and check their selected flag instead.

Meta