scripting documentation : UI Controls

Hi,
There doesn’t seem to be any documentation on a couple of the new UI controls in the scripting section of the manual.
Would be really good to add examples/tutorials to the webpage/online manual on how to use them and their variables/values.

In particular:

ColorControl
ProgressBarControl
SliderControl

I can find examples of the ColorControl and hence its code in other scripts easily enough, but not the other two…either way, would be good to know what values they are expecting on creation :slight_smile:

Thanks,
Mike

Yeah, we should probably document these controls better. Here is some basic info on how they’re used:

Color Control

To add a color control to the script dialog, use AddControl. For example:

scriptDialog.AddControl( "Test1", "ColorControl", Color.Red, 200, -1 )

The parameters are name (string), control type (string), initial value (Color), control width (integer), control height (integer). Note that the Color type is from System.Drawing.Color:
msdn.microsoft.com/en-us/library … color.aspx

So you need to import System.Drawing before you can use it:

from System.Drawing import *

ProgressBarControl

This is just like a RangeControl. For example:

scriptDialog.AddRangeControl( "Test2", "ProgressBarControl", 33, 1, 100, 0, 0, 200, -1 )

In this case, we would use the following to set the progress to 66:

scriptDialog.SetValue( "Test2", 66 )

SliderControl

This is also just like a range control, but it appears this control in broken in Deadline 4.0. :confused: So we’ll have to fix this for 4.1. To use it though, here is an example:

scriptDialog.AddRangeControl( "Test5", "SliderControl", 33, 1, 100, 0, 1, 200, -1 )

Cheers,

  • Ryan