AddItem (PPGLayout) *

Introduced

4.0

Description

Adds a control to the PPGLayout. Normally this new item will represents a parameter on the object that is inspected, and will allow a user to view and change its value. For example this method can be used to add a Slider control which shows the value of a numeric parameter on a CustomProperty.

It is possible to add any kind of control using this method. However convenience methods such as PPGLayout.AddColor have been added for some of the most common controls.

Often a call to this method is followed by one or more calls to PPGItem.SetAttribute to provide additional information about the appearance of the item.

Scripting Syntax

PPGLayout.AddItem( ParamName, [Label], [UIType] )

C# Syntax

PPGItem PPGLayout.AddItem( String in_ParamName, String in_opt_Label, String in_opt_UIType );

Parameters

Parameter

Type

Description

ParamName

String

Scripting name of the Parameter. The call does not fail even if no parameter by this name exists. However in that case the control is not drawn as part of the layout. (See PPGItem.Name).

Label

String

Most controls have a label, for example the text that appears to the left of a numeric slider. If not specified here, the name of the parameter (see SIObject.Name) or Parameter.ScriptName is shown instead. (See PPGItem.Label).

UIType

siPPGControlType

Specify the control to draw. For example this argument can be used to specify that a parameter should be displayed as a combo box. (See PPGItem.Type).

If not specified, XSI uses a simple heuristic for determining what control to use, based on the Parameter.ValueType. For example strings have an edit control, numeric types like Float and Integer use a slider, and Boolean parameters use a checkbox.

Return Value

PPGItem

See Also

Parameter.ScriptName

PPGLayout.AddString

PPGLayout.AddEnumControl

PPGLayout.AddColor

PPGLayout.AddButton

PPGLayout.AddGroup

PPGLayout.AddTab

 



SOFTIMAGE|XSI v6.01     

Return to Softimage XSI Index