49 lines
1.4 KiB
Text
49 lines
1.4 KiB
Text
.topic widget.combobox
|
|
.title ComboBox
|
|
.toc 1 ComboBox
|
|
.index ComboBox
|
|
.index wgtComboBox
|
|
.index wgtComboBoxSetItems
|
|
.index wgtComboBoxGetSelected
|
|
.index wgtComboBoxSetSelected
|
|
|
|
.h2 ComboBox
|
|
|
|
A combination of a text input and a dropdown list. The user can either type a value or select from a list of predefined options. Unlike Dropdown, the text field is editable.
|
|
|
|
Header: widgets/widgetComboBox.h
|
|
|
|
.h3 Creation
|
|
|
|
.code
|
|
WidgetT *cb = wgtComboBox(parent, 128);
|
|
const char *items[] = { "Arial", "Courier", "Times" };
|
|
wgtComboBoxSetItems(cb, items, 3);
|
|
.endcode
|
|
|
|
.h3 Macros
|
|
|
|
.table
|
|
Macro Description
|
|
----- -----------
|
|
wgtComboBox(parent, maxLen) Create a combo box. maxLen is the maximum text input length.
|
|
wgtComboBoxSetItems(w, items, count) Set the dropdown items.
|
|
wgtComboBoxGetSelected(w) Get the index of the selected item (-1 if the text does not match any item).
|
|
wgtComboBoxSetSelected(w, idx) Set the selected item by index.
|
|
.endtable
|
|
|
|
.h3 Events
|
|
|
|
.table
|
|
Callback Description
|
|
-------- -----------
|
|
onChange Fires when the text or selection changes.
|
|
.endtable
|
|
|
|
.h3 Properties (BASIC Interface)
|
|
|
|
.table
|
|
Property Type Access Description
|
|
-------- ---- ------ -----------
|
|
ListIndex Integer Read/Write Index of the currently selected item.
|
|
.endtable
|