RE: [script] Disable/hide UIItem in PPGLayout

Date : Fri, 22 Jul 2005 14:15:04 -0400
To : <XSI(at)Softimage.COM>
From : "Stephen Blair" <stephen_blair(at)Softimage.COM>
Subject : RE: [script] Disable/hide UIItem in PPGLayout
function MyProperty_combo_OnChanged( )
{
	var oLayout = PPG.PPGLayout;
	
	var oPPGItem = oLayout.Item( "text1" );
	
	// DISABLE/HIDE HERE!!!
	PPG.text1.ReadOnly = true;
	
	PPG.Refresh()
}

-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM]On Behalf
Of Bernard Lebel
Sent: Fri 22 July 2005 1:46 PM
To: XSI(at)Softimage.COM
Subject: [script] Disable/hide UIItem in PPGLayout


Hello,

I have a little ppg, with 3 parameters. The first two are text fields.
The third is a combo. Basically I want that when switching the combo,
one of the two parameters gets either disabled (read-only), or
completely hidden.

I'm very new to this stuff, I haven't found any info about such a
thing in the docs. Any suggestion? Below is my code, I hope it won't
get too massacred by formatting...


Thanks
Bernard



function XSILoadPlugin( in_reg )
{
	in_reg.Author = "Bernard Lebel";
	in_reg.Name = "MyPropertyPlugin";
	in_reg.Major = 1;
	in_reg.Minor = 1;
	in_reg.RegisterProperty( "MyProperty" );
	return true;
}


function MyProperty_Define( io_Context )
{
	var oCustomProperty = io_Context.Source;
	oCustomProperty.AddParameter2( "text1", siString, "", null, null,
null, null, 0, siPersistable );
	oCustomProperty.AddParameter2( "text2", siString, "", null, null,
null, null, 0, siPersistable );
	oCustomProperty.AddParameter2( "combo", siString, "text1", null,
null, null,null, 0, siPersistable );
}


function MyProperty_DefineLayout( io_Context )
{
	var oLayout = io_Context.Source;
	oLayout.Clear(  );
	
	aArray = new Array( "text1", "text1", "text2", "text2" );
	
	oLayout.additem( "text1" );
	oLayout.additem( "text2" );
	oLayout.AddEnumControl( "combo", aArray, "Choose", siControlCombo );
	
	oLayout.Logic = MyProperty_OnInit.toString() +
			MyProperty_combo_OnChanged.toString()
}


function MyProperty_OnInit( )
{
}



function MyProperty_combo_OnChanged( )
{
	var oLayout = PPG.PPGLayout;
	
	var oPPGItem = oLayout.Item( "text1" );
	
	// DISABLE/HIDE HERE!!!
	
	PPG.Refresh()
}

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.