XSIDialog

Object Hierarchy

Introduced

2.0

Description

This object allows you to launch a simple modal dialog contained a drop down list of strings. It is particularly useful when asking the user to select from a dynamically generated list of items.

An alternative approach is to use a Combo control on a CustomProperty (see PPGLayout.AddEnumControl).

Methods

Combo | ComboEx

Examples

1. VBScript Example

    dim XSIDial, aItems
    set XSIDial = CreateObject("XSIDial.XSIDialog" )

    aItems = Array( "Item1", "Item2", "Item3" )
    indx = XSIDial.ComboEx( "Window Title", aItems, 2 )

    if ( indx = -1 ) then
       Application.LogMessage "User cancelled"
    else
       Application.LogMessage "User selected: " & aItems( indx )
    end if

2. JScript Example

    /*
       Demonstrates how you can ask the user to pick an object
       based on a list of object names
    */

    NewScene(null, false);

    // Create 4 nulls, with one nested underneath another
    GetPrim("Null", "FirstNull");
    GetPrim("Null", "MiddleNull");
    var oLastNull = GetPrim("Null", "LastNull");
    oLastNull.AddPrimitive("Null", "HiddenNull");

    // Look for our nulls based on the naming convention
    var dummy;
    var oNulls = ActiveSceneRoot.FindChildren( "*Null", dummy, dummy, true );

    // Fill their names into a string
    var aNames = new Array();

    for ( i=0 ; i<oNulls.Count; i++ ) {
       aNames.push( oNulls.Item(i).FullName );
    }

    // Often it is convenient to sort objects
    XSIUtils.QuickSort( aNames )

    var oDial = new ActiveXObject( "XSIDial.XSIDialog" );

    // Ask the user to pick a null
    indx = oDial.Combo( "Pick a Null", aNames );

    if ( indx != -1 ) {
       InspectObj( aNames[indx] );
    }

See Also

CustomProperty

Autodesk Softimage v7.5