v2.0
このオブジェクトは、文字列のドロップダウンリストに含まれる簡単なモードダイアログを起動します。動的に生成される項目リストから選択するようユーザに要求する場合は、特に便利です。
CustomProperty の Combo コントロールを使用する方法もあります(「PPGLayout.AddEnumControl」を参照)。
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 |
/* 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] ); } |