OnChanged

Description

This callback is fired when the user changes a parameter value in a property page control (for example, by selecting an item from a drop-down list, changing the value in a field, or selecting a check box).

Note that changing the contents of a list box (setting UIItems property) does not trigger an OnChanged callback.

To access the property page from the callback code, use the PPG object.

Applies To

Custom Properties implemented in a scripting language

Syntax

    // JScript
    function <property_name>_<parameter_name>_OnChanged()
    {
       ...
    }

    # Python
    def <property_name>_<parameter_name>_OnChanged():
       ...

    ' VBScript
    Function <property_name>_<parameter_name>_OnChanged()
       ...
    End Function

    # Perlscript
    sub <property_name>_<parameter_name>_OnChanged
    {
       ...
    }

<property_name> is the name specified in the call to RegisterProperty, with any spaces removed. For example, if you register a property with the name "My Property", the callback function names start with "MyProperty".

Example

    // JScript
    // Enable/disable a text box based on the state of a check box
    function MyProperty_MyCheckbox_OnChanged( )
    {
       var bFlag = PPG.MyCheckbox.Value;

       // If the check box is cleared, disable the text box
       if ( bFlag == false )
       {
           PPG.MyTextBox.ReadOnly = true;
       }
       else
       {
           PPG.MyTextBox.ReadOnly = false;
       }

       PPG.Refresh()
    }

See Also

• Define

• DefineLayout

• OnClicked

• OnClosed

• OnInit

• OnTab

• PPGEvent

• Property Callbacks

Autodesk Softimage v7.5