EAGLE Help

dlgComboBox


Function
Defines a combo box selection field.

Syntax
dlgComboBox(string array[], int &Selected) [ statement ]

Description
The dlgComboBox statement defines a combo box selection field with the contents of the given array.

Selected reflects the index of the selected combo box entry. The first entry has index 0.

Each element of array defines the contents of one entry in the combo box. None of the strings in array may be empty (if there is an empty string, all strings after and including that one will be dropped).

The optional statement is executed whenever the selection in the dlgComboBox changes.
Before the statement is executed, all variables that have been used with dialog objects are updated to their current values, and any changes made to these variables inside the statement will be reflected in the dialog when the statement returns.

If the initial value of Selected is outside the range of the array indexes, it is set to 0.

See also dlgListBox, dlgLabel, Layout Information, A Complete Example

Example

string Colors[] = { "red", "green", "blue", "yellow" };
int Selected = 2; // initially selects "blue"
dlgComboBox(Colors, Selected) dlgMessageBox("You have selected " + Colors[Selected]);

Index Copyright © 2005 CadSoft Computer GmbH