ComboBox Class Reference

The ComboBox JavaScript class. A simplified version of the ComboBox Qt widget. More...

Properties

StringList itemList
 The stringlist of items. More...
 
String currentItem
 The currently selected item. More...
 
bool editable
 Toggle whether the combo box may be edited by the user. More...
 
int currentItemPos
 The index of the current item. More...
 

Detailed Description

The ComboBox JavaScript class. A simplified version of the ComboBox Qt widget.

var myDialog = new Dialog();
myDialog.title = “ComboBox Example”;
var userInput = new ComboBox();
userInput.label = “What is your favourite colour?”
userInput.editable = true;
userInput.itemList = [“Red”, “Green”, “Blue”, “Yellow”, “White”, “Pink”, “Orange”, “Purple”, “Black”];
myDialog.add( userInput );
if ( myDialog.exec() )
MessageLog.trace(“The user’s favourite colour is “ + userInput.currentItem + “.”);

Property Documentation

◆ currentItem

String ComboBox::currentItem
readwrite

The currently selected item.

◆ currentItemPos

int ComboBox::currentItemPos
readwrite

The index of the current item.

◆ editable

bool ComboBox::editable
readwrite

Toggle whether the combo box may be edited by the user.

◆ itemList

StringList ComboBox::itemList
readwrite

The stringlist of items.