RE: [scripting] Check Box onChanged event

Date : Fri, 9 May 2008 12:44:20 -0500
To : <XSI(at)Softimage.COM>
From : "Matt Lind" <mlind(at)carbinestudios.com>
Subject : RE: [scripting] Check Box onChanged event
You are assigning the events to oLayout.Logic twice.  As a result, only the last assignment is valid.
 
Your code should read as follows:
 
    oLayout.Logic = Switcher_OnClicked.toString() + Clicker_OnClicked.toString();
 
 
Matt
 
 
 
 
 


From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Byron Nash
Sent: Friday, May 09, 2008 6:38 AM
To: xsi(at)Softimage.COM
Subject: [scripting] Check Box onChanged event

Does a siBool(check box) have an onChanged or onClicked event? I'm trying to enable/disable a ui control with a check box. I have it working with a button using onClicked, but I can't seem to get the check box to register with either event. What am I missing?

var oPSet = ActiveSceneRoot.AddProperty( "CustomProperty", false, "ButtonExample" ) ;

oPSet.AddParameter3( "Checker", siBool, 1 ) ;
oPSet.AddParameter3( "Switcher", siBool, 1 ) ;

var oLayout = oPSet.PPGLayout

oLayout.AddButton( "Clicker" ) ;
oLayout.AddItem("Switcher");
oLayout.AddItem("Checker");

oLayout.Logic = Switcher_OnClicked.toString() ;

oLayout.Logic = Clicker_OnClicked.toString() ;
oLayout.Language = "JScript" ;

InspectObj( oPSet ) ;

function Clicker_OnClicked()
{
    LogMessage("clicked button");
    LogMessage("Checker is:" + PPG.Checker.ReadOnly);
    if(PPG.Checker.ReadOnly){
        PPG.Checker.ReadOnly = false;
    }else{
        PPG.Checker.ReadOnly = true;
       }

    PPG.refresh();
}

function Switcher_OnClicked()
{
    LogMessage("clicked Switcher");
   
    if(PPG.Checker.ReadOnly){
        PPG.Checker.ReadOnly = false;
    }else{
        PPG.Checker.ReadOnly = true;
    }
    PPG.refresh();   
}


--
Byron Nash

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.