StringComboBox

The value type StringComboBox is used to create a combo box for a string input.

../../../../_images/StringComboBox.png

Syntax

<Parameter>
<Name>StringComboBoxValue</Name>
<Value>Text1</Value>
<ValueList>Text1|Text2|Text3</ValueList>
<ValueType>StringComboBox</ValueType>
</Parameter>

Additional info about the <Value> and <ValueList> tag are shown here Value and ValueList

Optional tags

If the PythonPart should be localized, the following tags must be added

<TextId>1001</TextId>
<ValueList_TextIds>1328|1327|1329</ValueList_TextIds>

Sometimes it’s useful to disable or hide the combo box depending on the value of another parameter. This is achieved by adding additional tags to the parameter or by defining functions in the py-file. See Enable and visible options

The persistent state of the parameter can be changed by adding

<Persistent></Persistent>

Example

The implementation of the StringComboBox value type is described in the example ComboBox, which is located in

…\etc\Examples\PythonParts\PaletteExamples\ComboBox.pyp
…\etc\PythonPartsExampleScripts\PaletteExamples\ComboBox.py

and

…\etc\Examples\PythonParts\PaletteExamples\ComboboxLocalisedStringValues.pyp
…\etc\PythonPartsExampleScripts\PaletteExamples\ComboboxLocalisedStringValues.py