combo box

Combo boxes are list windows containing an arrow on the right side and displaying only one selected option from a list. Clicking on the arrow opens a drop-down list containing all the options. An option is selected by clicking on it in the list. The list then closes and only the selected item remains visible.

Combo boxes allow you to choose only one option from a list of pre-defined alternatives. Since only the selected option is displayed once the selection has been made, a combo box does not take up much space in a system diagram.

Figure 1. combo box

To create a combo box

  1. Click on the combo box tool .

  2. Click in the panel work area. Define the size.

  3. Open the Property Sheet.

  4. Enter the object name beside (Name).

  5. Enter the options using the editor. The editor is opened via the ... button.

Clicking on the Add After button places the new option after the option selected in the editor. Clicking on the Add Before button places the new option in front of the option selected in the editor. An option can be renamed by clicking on the Rename button. Clicking on the Remove button deletes the selected option.

If you have made the combo box too wide or too narrow for the options, you can change the width of the box afterwards by selecting the box and then dragging the corresponding boundary marking with the mouse.

  1. The text formatting for the options as well as the color of the combo box can be edited in the Property Sheet.

A double-click on the combobox in the panel during engineering opens the Combobox Editor.

Several characters can be typed to find an entry easier. Note that the characters have to be typed in quick succession since there is a time-out between the characters.

Example

In the following example, a valve VS01 can be closed, opened or adjusted to three different positions. The dpSet() function sets the original value of the data point variables "VS01.Adjustment" to the value given by the selected box option. It is assumed that the original values 0, 1, 2 and 3 are assigned to the different adjustment settings, and the options in the combo box are "Closed", Open to 1", "Open to 2" and "Open to 3".

main()
{
  string txt;
  getValue("", "text",txt);
  if(txt == "Closed")
  dpSet("VS01.Adjustment:_original.._value ",0);
  else if(txt =="Open to 1")
  dpSet("VS01.Adjustment:_original.._value",1);
  else if(txt == "Open to 2")
  dpSet("VS01.Adjustment:_original.._value ",2);
  else if(txt =="Open to 3")
  dpSet("VS01.Adjustment:_original.._value",3);
}                        

For combo box functions see Control Graphics/combo box functions