DVX_GUI/widgets/listBox/listBox.dhs

78 lines
2.4 KiB
Text

.topic widget.listbox
.title ListBox
.toc 1 ListBox
.index ListBox
.index wgtListBox
.index wgtListBoxSetItems
.index wgtListBoxGetSelected
.h2 ListBox
A scrollable list of text items. Supports single and multi-selection modes and drag-to-reorder.
Header: widgets/widgetListBox.h
.h3 Creation
.code
WidgetT *lb = wgtListBox(parent);
const char *items[] = { "Alpha", "Beta", "Gamma" };
wgtListBoxSetItems(lb, items, 3);
.endcode
.h3 Macros
.index wgtListBoxSetSelected
.index wgtListBoxSetMultiSelect
.index wgtListBoxIsItemSelected
.index wgtListBoxSetReorderable
.index wgtListBoxSelectAll
.index wgtListBoxClearSelection
.table
Macro Description
----- -----------
wgtListBox(parent) Create a list box.
wgtListBoxSetItems(w, items, count) Set the list items.
wgtListBoxGetSelected(w) Get the index of the selected item (-1 if none).
wgtListBoxSetSelected(w, idx) Set the selected item by index.
wgtListBoxSetMultiSelect(w, multi) Enable or disable multi-selection mode.
wgtListBoxIsItemSelected(w, idx) Check if a specific item is selected (multi-select mode).
wgtListBoxSetItemSelected(w, idx, selected) Select or deselect a specific item.
wgtListBoxSelectAll(w) Select all items (multi-select mode).
wgtListBoxClearSelection(w) Deselect all items.
wgtListBoxSetReorderable(w, reorderable) Enable drag-to-reorder.
.endtable
.h3 Events
.table
Callback Description
-------- -----------
onClick Fires when an item is clicked.
onDblClick Fires when an item is double-clicked.
onChange Fires when the selection changes.
.endtable
.h3 Properties (BASIC Interface)
.table
Property Type Access Description
-------- ---- ------ -----------
ListIndex Integer Read/Write Index of the currently selected item.
.endtable
.h3 Methods (BASIC Interface)
.table
Method Description
------ -----------
SelectAll Select all items.
ClearSelection Deselect all items.
SetMultiSelect Enable or disable multi-selection.
SetReorderable Enable or disable drag-to-reorder.
IsItemSelected Check if a specific item is selected by index.
SetItemSelected Select or deselect a specific item by index.
.endtable
.hr