ComboBox - Basic Object

Description

A comboBox is a commonly used graphical user interface widget.  Traditionally, it is a drop-down list allowing the user to select a value from the list.  The term “comboBox” is sometimes used to mean “drop-down list”

Properties and Functions

Info

  • Name
  • Size
  • Location
  • ZIndex
  • Draggable

Configuration

  • Angle
  • Input Enabled
  • Number of Decimals
  • Corner Radius
  • Items List
  • Selected Index
  • Selected Text
  • HotKey
  • Is Enabled
  • Is Visible
  • ToolTip

Functions

  • .FontColor
  • .SelectedIndex
  • .SelectedText
  • .Items
  • .InsertItem()
  • .InsertItemsFromTag()
  • .RemoveSelectedItem()
  • .RemoveItem()
  • .RemoveAllItems()

Inserting a Combobox

To create a new ComboBox in the Graphics Document:

  1. Click the “ComboBox” button within the Basic Objects Ribbon.
  2. Place the mouse pointer in the place where you want to create the ComboBox.
  3. Click to create the new ComboBox.

Configuring the Combobox

The ComboBox can be configured in 2 different ways. 

  1. Static items
  2. Array of Tags

1. Static Items

The list of items are defined during the application development. 

To add them, you just need to click the [+] button and a new item will be added.  Then double click the new item text added and you will be able to edit the text.  The image below shows 3 static items added manually

After executing the application, the ComboBox will show the following options:

2. Array of Tags

it is possible to configure a dynamic array or a simple array to populate the ComboBox list.

The image below shows an array of String (@arrayOptions) configured.

The array was initialized in the Startup Script with the following values:

@arrayOptions[0] = “Array position 0”;
@arrayOptions[1] = “Array position 1”;
@arrayOptions[2] = “Array position 2”;
@arrayOptions[3] = “Array position 3”;
@arrayOptions[4] = “Array position 4”;

 After executing the application, the ComboBox will show the following options:


Selected Index and Selected Text

The ComboBox has the option to get and set the selected index and selected text.

This can be done by configuring tags:

  • Selected Index – (configure an integer tag)
  • Selected Text- (configure a string tag)

And there is also an alternative to use the Properties in a script. 

  • .SelectedIndex
  • .SelectedText

The image below displays the Selected index and Selected Text configured with tags in 2 labels.

Script Events

The object provides several Script Events for the user.  The ComboBox object does have an extra event that doesn’t exist for other objects (Selection Changed event).  This particular event will be executed every time a different ComboBox item is selected.

  • Mouse Up
  • Mouse Down
  • Mouse While
  • Mouse Right Up
  • Mouse Right Down
  • Mouse Double Click
  • Selection Changed

Security

It is possible to configure different permissions per profile for this object.  For further information, please check the Security white paper.