[scripting] Check Box onChanged event

Date : Fri, 9 May 2008 09:37:32 -0400
To : xsi(at)Softimage.COM
From : "Byron Nash" <byronnash(at)gmail.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.