ComboBox

Description

Defines a combo box with a list of items.  The combo box items can contain images, text or both.

Keys


  • Label - an optional label that will be displayed to the left of the combo box
  • LabelWidth - double value representing the percentage of the grid container the label will consume in the dialog
    • The label gets defined percent width of the dialog
    • The text field gets the leftover percentage width of the dialog
    • Default value is 50% of the grid is utilized by the label if this key is excluded
  • Option – the index for the default selected item (index starts at 1)
  • ListControls – table containing the items inside the combo box which can be two different formats:
    • A simple table containing strings:  ListControls={"Option 1", "Option 2", "Option 3"}
    • A table containing a list of tables which include the following keys:
      • Text - the string that is displayed for the combo box option
      • ImageName - the name of the image file located in the Image directory of your Lua plug-in.  
  • CallbackFunc – the name of the Lua function to call when the status is changed

Return


  • ["ControlID"["SelectedItem"] – key for the return table to provide the name of the selected item
  • ["ControlID"]["Option"] – key name that returns the index for the selected item (index starts at 1)


Example


data = { ControlID="myComboBox", ControlType="ComboBox", Option=1, ListControls={"Option 1", "Option 2", "Option 3"}, CallbackFunc=myFunctionName }


The return data can be accessed from (assuming the dialog return variable is named retTable ):

       retTable["myComboBox"]["Option"] = The selected item index (1 -> n items)

       retTable["myComboBox"]["SelectedItem"] = The string of the selected item