PDA

View Full Version : Interactive Slider



Kevbarnes
03-18-2012, 11:50 AM
Hi I trying to script an interactive slider.
'
see Attached rar file with scripts 'version01' and 'version02'

I've got so far with 'v01' which establishes the slider
but I don't know how to implement what I think is a 'Call-Back'?.

I've tride using 'reqopen' and adding what I think is a refresh action on the slider

but nothing seems to work - is this possible?

evenflcw
03-18-2012, 01:05 PM
You should use the callback to set your internal data variable. Also don't forget to set the initial value of the control to the same as the internal one so they don't start out of synch.


options
{
if(reqisopen()) reqend(); //closes previous panel if any open
reqbegin("SliderControl");

c0 = ctlchoice("Control Axis",ControlPos,@"X","Y","Z"@);
c2 = ctlslider("Slider",1,1,100);

setvalue(c2, SlideAmount); //starting value when panel opens

ctlrefresh(c2,"refresh1");

reqopen();
}


refresh1: value
{
SlideAmount = value; //or = getvalue(c2);
}

Kevbarnes
03-18-2012, 06:23 PM
thanks evenflcw

that now works great.

I'll have to do the same action on the 'Axis choice' variable as its only getting the initial value.

Many thanks

Kev