Object Hierarchy | 関連する C++クラス:PPGItem
v4.0
このオブジェクトは、プロパティページのユーザインターフェイスのコンポーネントです。通常、PPGItem は、検証されるオブジェクトの Parameter に直接関係するユーザインターフェイスコントロールです。たとえば、タイプが siControlStringである PPGItem は、Stringパラメータの値を表示します。同様に、タイプが siControlFCurve である PPGItem は、FCurve Parameter内に含まれる F カーブを表示します。コントロールと関連する Parameter との接続は、PPGItem.Name をベースにして確立されます。
Buttons、Tabs、Groups などのその他の PPGItem は、パラメータに直接対応するものではありません。
各 PPGItem は、その外観の調整に使用できる一連の「属性」を表示します。PPGItem.Label などの非常に一般的な属性には、オブジェクトのプロパティとして直接表示されるものもあります。また、専門的で、あまり一般的でない属性には、PPGItem.GetAttribute を介してアクセスします。
PPGItem オブジェクトには、ProjectItem の PPGLayout を介してアクセスします。
'example demonstrating using the PPGItem
'object to set the Labels of an object.
dim oPSet,oPPGLayout, oItem
set oPSet=ActiveSceneRoot.AddProperty("CustomProperty",false,"Demo")
oPSet.AddParameter3 "Check1", siBool
oPSet.AddParameter3 "Check2", siBool
set oPPGLayout = oPSet.PPGLayout
oPPGLayout.AddGroup "", true
oPPGLayout.AddRow
oPPGLayout.AddItem "Check1"
set oItem = oPPGLayout.AddItem( "Check2" )
oItem.Label = "Check Box 2"
oPPGLayout.EndRow
oPPGLayout.EndGroup
'We can look up and change the items afterwards
set oItem = oPPGLayout.Item( "Check1" )
oItem.Label = "Check Box 1"
'Show our PPG
InspectObj oPSet |
//example building a layout with two Controls for selecting a
//filepath and one for selecting a folder.
var oPSet=ActiveSceneRoot.AddProperty("CustomProperty",false,"Demo") ;
oPSet.AddParameter3( "ExportFile", siString ) ;
oPSet.AddParameter3( "ImportFile", siString ) ;
oPSet.AddParameter3( "FolderPicker", siString ) ;
var oPPGLayout = oPSet.PPGLayout ;
var oItem = oPPGLayout.AddItem( "ExportFile","Export Filename",siControlFilePath ) ;
// You can use the string directly, or the typdef siUIInitialDir (see siPPGItemAttribute enum)
oItem.SetAttribute( "initialdir", "project" ) ;
oItem.SetAttribute( siUIFileFilter, "Text files (*.txt)|*.txt|All Files (*.*)|*.*||" ) ;
var oItem = oPPGLayout.AddItem( "ImportFile","",siControlFilePath ) ;
oItem.SetAttribute( siUIFileFilter,
"spdl files (*.spdl)|*.spdl|" +
"xsiaddon files (*.xsiaddon)|*.xsiaddon|" +
"All Files (*.*)|*.*||" );
oItem.SetAttribute( siUIOpenFile, true ) ;
oItem.SetAttribute( siUIInitialDir, "factory" ) ;
oItem.SetAttribute( siUISubFolder, "Application/spdl" ) ;
oItem.SetAttribute( siUIFileMustExist, true );
var oItem = oPPGLayout.AddItem( "FolderPicker", "", "Folder" );
oItem.SetAttribute( siUIInitialDir, "user" ) ;
InspectObj( oPSet ); |