PIXEL UI
ComboBox

PIXEL.ComboBox

Methods

The following methods are available on the PIXEL.ComboBox panel:

PANEL:Clear()

Clears all combo box choices and selection state.

string PANEL:GetOptionText( number )

Returns display text for a choice by index.

any PANEL:GetOptionData( number )

Returns associated data for a choice by index.

any PANEL:GetOptionTextByData( any )

Resolves display text for a matching data value.

PANEL:ChooseOption( string, number )

Selects a choice and updates displayed value.

PANEL:ChooseOptionID( number )

Selects a choice by index.

number PANEL:GetSelectedID()

Returns the selected choice index.

string, any PANEL:GetSelected()

Returns the currently selected text and data.

PANEL:OnSelect( number, string, any )

Callback fired when a choice is selected.

number PANEL:AddChoice( string, any, boolean, string )

Adds a selectable choice to the combo box.

boolean PANEL:IsMenuOpen()

Returns whether the dropdown menu is currently open.

PANEL:CloseMenu()

Closes and removes the dropdown menu if open.

PANEL:CheckConVarChanges()

Synchronizes displayed value from the bound console variable.

PANEL:SetValue( string )

Sets the currently displayed combo box text.