FormComboBox
A combo box item. A combo box provides a list of options of which at least one must be selected.
Example
form = pf.Form.New("Export settings") -- Prepare input parameter and create combo box options = {} table.insert(options, "Only electric near fields") table.insert(options, "Only magnetic near fields") table.insert(options, "Both electric and magnetic near fields") combobox = pf.FormComboBox.New("Results to export:", options) form:Add(combobox) -- Run the form and retrieve the user input form:Run() exportOptionSelected = combobox.Value
Inheritance
The FormComboBox object is derived from the FormLabelledItem object.
Usage locations
The FormComboBox object can be accessed from the following locations:
- Static functions
- FormComboBox object has static function New(string, Map of number:Expression).
- FormComboBox object has static function New(Map of number:Expression).
Property List
- Count
- The number of combo box items. (Read only number)
- Enabled
- Controls the item enabled state. Setting the enabled state of an item to false will also disable items or their contents. (Read/Write boolean)
- FixedHeight
- The fixed height of the item in pixels. When the fixed height is set to a positive value, it is the height of the item. Setting the fixed height to zero or a negative value will restore the default/auto setting and the height will be dynamically determined. The fixed height takes precedence over the minimum height and thus the minimum height is ignored when a fixed height is set. (Read/Write number)
- FixedWidth
- The fixed width of the item in pixels. When the fixed width is set to a positive value, it is the width of the item. Setting the fixed width to zero or a negative value will restore the default/auto setting and the width will be dynamically determined. The fixed width takes precedence over the minimum width and thus the minimum width is ignored when a fixed width is set. (Read/Write number)
- Index
- The index of the selected item in the combo box item. (Read/Write number)
- ItemHeight
- The height of the item in pixels. (Read only number)
- ItemWidth
- The width of the item in pixels. (Read only number)
- MinimumHeight
- The minimum height of the item in pixels. When the height is dynamically determined, it will not be less than the minimum height setting. The minimum height value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum height to zero or a negative value will restore the default/auto setting where no minimum height is enforced. (Read/Write number)
- MinimumWidth
- The minimum width of the item in pixels. When the width is dynamically determined, it will not be less than the minimum width setting. The minimum width value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum width to zero or a negative value will restore the default/auto setting where no minimum width is enforced. (Read/Write number)
- Options
- The options available in the combo box. (Read/Write Map of number:Expression)
- Type
- The object type string. (Read only string)
- Value
- The text of the selected item in the combo box item. (Read/Write Expression)
- Visible
- Controls the item visibility. Setting the visibility of an item to false will also hide items or their contents. (Read/Write boolean)
Method List
- ClearCallBack ()
- Clear the function that will be called when the check box state changes.
- LabelItem ()
- Returns the built-in label object associated with the form item. This allows access to the label like a normal form label. (Returns a FormLabel object.)
- SetCallBack (callback function)
- Set the function that will be called when the item's action has triggered.
Constructor Function List
- New (label string, map Map of number:Expression)
- Create a new combo box item. (Returns a FormComboBox object.)
- New (map Map of number:Expression)
- Create a new combo box item. (Returns a FormComboBox object.)
Property Details
- Count
- The number of combo box items.
- Type
- number
- Access
- Read only
- Enabled
- Controls the item enabled state. Setting the enabled state of an item to false will also disable items or their contents.
- Type
- boolean
- Access
- Read/Write
- FixedHeight
- The fixed height of the item in pixels. When the fixed height is set to a positive value, it is the height of the item. Setting the fixed height to zero or a negative value will restore the default/auto setting and the height will be dynamically determined. The fixed height takes precedence over the minimum height and thus the minimum height is ignored when a fixed height is set.
- Type
- number
- Access
- Read/Write
- FixedWidth
- The fixed width of the item in pixels. When the fixed width is set to a positive value, it is the width of the item. Setting the fixed width to zero or a negative value will restore the default/auto setting and the width will be dynamically determined. The fixed width takes precedence over the minimum width and thus the minimum width is ignored when a fixed width is set.
- Type
- number
- Access
- Read/Write
- Index
- The index of the selected item in the combo box item.
- Type
- number
- Access
- Read/Write
- ItemHeight
- The height of the item in pixels.
- Type
- number
- Access
- Read only
- ItemWidth
- The width of the item in pixels.
- Type
- number
- Access
- Read only
- MinimumHeight
- The minimum height of the item in pixels. When the height is dynamically determined, it will not be less than the minimum height setting. The minimum height value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum height to zero or a negative value will restore the default/auto setting where no minimum height is enforced.
- Type
- number
- Access
- Read/Write
- MinimumWidth
- The minimum width of the item in pixels. When the width is dynamically determined, it will not be less than the minimum width setting. The minimum width value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum width to zero or a negative value will restore the default/auto setting where no minimum width is enforced.
- Type
- number
- Access
- Read/Write
- Options
- The options available in the combo box.
- Access
- Read/Write
- Type
- The object type string.
- Type
- string
- Access
- Read only
- Value
- The text of the selected item in the combo box item.
- Type
- Expression
- Access
- Read/Write
- Visible
- Controls the item visibility. Setting the visibility of an item to false will also hide items or their contents.
- Type
- boolean
- Access
- Read/Write
Method Details
- ClearCallBack ()
- Clear the function that will be called when the check box state changes.
- LabelItem ()
- Returns the built-in label object associated with the form item. This allows access to the label like a normal form label.
- Return
- FormLabel
- The form label item.
- SetCallBack (callback function)
- Set the function that will be called when the item's action has triggered.
- Input Parameters
- callback(function)
- The function call back.
Static Function Details
- New (label string, map Map of number:Expression)
- Create a new combo box item.
- Input Parameters
- label(string)
- The text description that will appear next to the combo box.
- map(Map of number:Expression)
- The combo box value index map. The map refers to a standard Lua table with numeric indexing.
- Return
- FormComboBox
- The combo box item created.
- New (map Map of number:Expression)
- Create a new combo box item.
- Input Parameters
- map(Map of number:Expression)
- The combo box value index map. The map refers to a standard Lua table with numeric indexing.
- Return
- FormComboBox
- The combo box item created.