Skip to content

PixelUI.ComboBox

Extends: PixelUI.Widget

A dropdown selection widget (combo box) for choosing from a list of options. Opens a dropdown menu when clicked.

Properties

NameTypeDescription
itemsstring[]Array of selectable items
selectedIndexintegerIndex of currently selected item
dropdownBgPixelUI.ColorBackground color for dropdown menu
dropdownFgPixelUI.ColorForeground color for dropdown menu
highlightBgPixelUI.ColorBackground color for highlighted item
highlightFgPixelUI.ColorForeground color for highlighted item
placeholderstring?Text shown when no item is selected
onChangefun(self:PixelUI.ComboBox,

Methods

new

lua
new()

_normalizeSelection

lua
_normalizeSelection()

setItems

lua
setItems()

getSelectedItem

lua
getSelectedItem()

setSelectedIndex

lua
setSelectedIndex()

setOnChange

lua
setOnChange()

_notifyChange

lua
_notifyChange()

_setOpen

lua
_setOpen()

onFocusChanged

lua
onFocusChanged()

_isPointInDropdown

lua
_isPointInDropdown()

_indexFromPoint

lua
_indexFromPoint()

_handlePress

lua
_handlePress()

draw

lua
draw()

_drawDropdown

lua
_drawDropdown()

handleEvent

lua
handleEvent()

Released under the MIT License.