Polybench® for biosignals / reference 1.34.1
User interface object that displays a list of values in a drop down box.

Drop Down List

Overview

The Drop Down List can be used to let the user select one item from a list of values. That value is then used in an Action ("Actions - Overview") which can be freely defined.

Properties

Find more information about changing properties here: "Properties Viewer"

Action
type: Select from the list
Select the code of the Action that is performed when a new value is selected in the drop down box.
Select one of those presets:


Value
type: See description [this value cannot be changed]
The value to write to the Address is determined automatically. It is either the technical name of the selected item, its value or its index (see Operation mode).


Address
type: Address, starts with '$' sign (see "Address - how to address objects and variable parameters")
Fill in the address of the object that should receive the Action.

You may type or paste the address, or you may press the small button on the right to open the Address Constructor ("Address Constructor")

SourceAddress
type: Address, starts with '$' sign (see "Address - how to address objects and variable parameters")
The Address of the parameter list that should be displayed in the drop down list.

You may type or paste the address, or you may press the small button on the right to open the Address Constructor ("Address Constructor")

Operation mode
type: Select from the list
The operation mode determines if the action Value contains the technical name, the visible value, or the index of the newly selected item.
Select one of those presets:
technical_name
If the selected item of the drop down box has changed, then an action is called using the item's technical name.
value
If the selected item of the drop down box has changed, then an action is called using the item's visible value.
index
If the selected item of the drop down box has changed, then an action is called using the item's index in the list (a value between 1 and the number of items in the list).


BackgroundColor
type: Known color name
The background color of the list. (Semi-)transparent colors are supported by the Drop Down List.

This property uses the Color Repository. For more information about the use of colors in a project, refer to "Color Repository"

ForegroundColor
type: Known color name
The color of texts and symbols in the drop down list

This property uses the Color Repository. For more information about the use of colors in a project, refer to "Color Repository"

GridColor
type: Known color name
The color of the items grid. Set to the background color or transparent to hide the grid.

This property uses the Color Repository. For more information about the use of colors in a project, refer to "Color Repository"

HighlightColor
type: Known color name
The color that is used to highlight the selected item.

This property uses the Color Repository. For more information about the use of colors in a project, refer to "Color Repository"

Font
type: Known text font name
The font of the text

This property uses the Font Repository. For more information about the use of text fonts in a project, refer to "Font Repository"

BorderStyle
type: See description
Select a border style from the drop-down box.


DropDownPosition
type: Select from the list
Select the position of the drop down list in relation to the object.
Select one of those presets:
BelowRight
Drop down below the hosting control. The list is offset towards the right.
Below
Drop down below the hosting control.
BelowLeft
Drop down below the hosting control. The list is offset towards the left.
Left
Drop down next to the hosting control, at the left side
Right
Drop down next to the hosting control, at the right side
AboveRight
Drop up above the hosting control. The list is offset towards the right.
Above
Drop up above the hosting control.
AboveLeft
Drop up above the hosting control. The list is offset towards the left.


ItemHeight
type: Integer value
The height of each item in the drop down list. If you set this to 0, then the height is determined automatically (default is 0).


Size
type: Size containing width and height
The size of the user interface of this object (width, height).


Coordinates
type: Coordinate
The location of the user interface of this object in (x,y) coordinates, relative to the object it is on top of.


Caption
type: Word or phrase
The name of the object in the project. This name must not contain '.', '$' nor '@' characters.

For more information about the rules and usage of the Caption property, please refer to "Caption property - background and usage".

Documentation
type: See description
Optional documentation of this object. If this object is an operator, the Documentation text is displayed below the operator symbol.

Variable Parameters

Find more information about Variable Parameters here: "Variable Parameters"

SourceAddress
type: See description
The Address of the parameter list that should be displayed in the drop down list.

You may use a SET_PARAMETER action somewhere else to change this list address. Please note that if you do that, that the Value of the action should be the address with two $ signs, otherwise not the address, but the contents behind the address are set in the SourceAddress variable, which does not make sense.
So, for example: $$Channel Name Splitter1.Channels.

Value
type: See description
The current value of the drop down list


TechnicalName
type: See description
The technical name of the selected item in the drop down list


Index
type: See description
The index of the selected item in the drop down list (a value between 1 and the number of items in the list)

Functions

Find more information about Functions here: "Operator Functions"

Select
Selects the specified item in the Drop Down box. If an action is specified for selecting an item, then this action is also executed.
Parameter:
The item to select. This may be either the item name, or the item index (first item has index 1).

Enable
Sets the drop down box to Enabled, so that it accepts user input.

Disable
Sets the drop down box to Disabled, so that it does not accept any user input.

Details

Specifying a list source

The Drop Down box works on all list types. In the SourceAddress property, you specify the list that contains the items that are displayed in the drop down box.

Many objects and operators in a Polybench application provide some kind of a list. You can see that by opening the variable parameters of an object. Lists are variables that display (Parameter List) or (Selectable List). You may select any of such variables as a list source.

Differences in list types

There are mainly two kinds of lists that you may want to select as a source for items in the drop down box. The most common one is the Parameter List. This is just a list of items for the drop down box.

Another type of list is the Selectable List. This type of lists provides the items in the drop down box, but it also allows to select one of the items in the object the Selectable List comes from. In that case, you don't need the Action of the drop down box, because the item selection is handled in the source object.

For example: a device source operator may offer a Selectable List variables to set the COM port number for the device. If you open the variable parameters ("Variable Parameters") of the operator, you could see a variable called Com port that displays (Selectable List) as value. If you use this variable as source of a drop down box (put the address in SourceAddress), then the drop down box will immediately change the com port number, when the user selects one in the drop down list.

Printing and screen shots

The Drop Down box can be used on printable pages and will also render to higher resolutions when addressed by a SNAPSHOT action.

Examples

Example: DF0700044_001_Drop_Down_List_Channel_Select_Demo
Demonstrates how the Drop Down List can be used to select a signal channel to be displayed in a viewer.

It works like this: A Channel Terminal gives each channel a unique name. A Channel Name Splitter selects one of the channels to display in the viewer. The selection is done by channel name.
Now, the Drop Down list needs to contact the Channel Terminal to get a list of channel names. And it needs to contact the Channel Name Splitter if a new item is selected. The Drop Down list does this by executing a SET_PARAMETER action that sets the selected channel name in the Channel Name Splitter, as soon as the user selects another channel.
Examples\DF0700044_001_Drop_Down_List_Channel_Select_Demo.xmc