PictureButton

The value type PictureButton is used to create a button with a picture from a png-file.

../../../../_images/PictureButton.png

Syntax

<Parameter>
<Name>PictureButtonRow</Name>
<Text>PictureButton</Text>
<ValueType>Row</ValueType>
<Parameter>
<Name>PictureButton</Name>
<Text>Tooltip text</Text>
<EventId>1000</EventId>
<Value>ButtonImageReset16.png</Value>
<ValueType>PictureButton</ValueType>
</Parameter>
</Parameter>

The button must be included in a Row, because there are two texts needed. One as description text on the left side and one for the tooltip text.

After clicking the button, the value of <EventId> can be processed by the function on_control_event in the PythonPart script (.py) file.

The value of the <Text> tag from the Button <Parameter> is displayed as a tooltip on the button.

The <Value> tag is used to set the name and path of the image file. The location of the file must be local to the pyp file.

Optional tags

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

<TextId>1001</TextId>

Sometimes it’s useful to disable or hide the picture button 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

Example

The implementation of the PictureButton value type is described in the example Button, which is located in

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