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 (link) which can be freely defined.Properties
Find more information about changing properties here: linkAction
type: Select from the listSelect the code of the Action that is performed when a new value is selected in the drop down box.
Select one of those presets:
The default Action is 'None', which means that no action is performed when you select a new value in the drop down list.
If you select the action SET_PARAMETER and a valid Address, then the technical name of the selected item will be written to the specified address.
If you select the action SET_PARAMETER and a valid Address, then the technical name of the selected item will be written to the specified address.
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 link)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 Searcher dialog (link)
SourceAddress
type: Address, starts with '$' sign (see link)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 Searcher dialog (link)
Operation mode
type: Select from the listThe 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).
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 nameThe 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 link
ForegroundColor
type: Known color nameThe text color
This property uses the Color Repository. For more information about the use of colors in a project, refer to link
GridColor
type: Known color nameThe 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 link
HighLightColor
type: Known color nameThe color that is used to high-light the a list item.
This property uses the Color Repository. For more information about the use of colors in a project, refer to link
Font
type: Known text font nameThe font of the text
This property uses the Font Repository. For more information about the use of text fonts in a project, refer to link
BorderStyle
type: See descriptionSelect a border style from the drop-down box.
DropDownPosition
type: Select from the listSelect 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.
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 valueThe 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 heightThe size of the user interface of this object (width, height).
Coordinates
type: CoordinateThe 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 phraseThe name of the object in the project. This name must not contain '.' or '$' characters.
Every object has the Caption property. This property is very important, because it is the name by which Polybench recognizes this object.
It is allowed to give multiple objects the same name, as long as the objects are of the same type. In that case, a reference to this caption includes all the objects with the same caption.
In Polybench, every object can be addressed by an Address specifier, which starts with the dollar sign, for example: $My Page.My Object. 'My Page' would be the Caption of a page, and 'My Object' the Caption of an object on that page.
It is allowed to give multiple objects the same name, as long as the objects are of the same type. In that case, a reference to this caption includes all the objects with the same caption.
In Polybench, every object can be addressed by an Address specifier, which starts with the dollar sign, for example: $My Page.My Object. 'My Page' would be the Caption of a page, and 'My Object' the Caption of an object on that page.
Documentation
type: See descriptionOptional documentation of this object.
It is good practice to write in short notes why you have used this object, and why its properties are set the way they are set. If this object is an operator, the Documentation text is displayed below the operator symbol.
Variable Parameters
Find more information about Variable Parameters here: linkSourceAddress
type: See descriptionThe 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.
So, for example: $$Channel Name Splitter1.Channels.
Value
type: See descriptionThe current value of the drop down list
TechnicalName
type: See descriptionThe technical name of the selected item in the drop down list
Index
type: See descriptionThe 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: linkSelect
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).
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 (link) 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