PDA

View Full Version : Question: Slider / Spinner - Sharing value in UI


ramirotell
10-18-2010, 12:19 AM
Hi people, i canīt solve something that seems to be very simple. I just need the value of the spinner to be related with the value of the slider, so when i change one of the, the other gets the same value on my UI rollout.
Something similar like when i use this ui relationship on an attribute holder in the Parameter section
exampe: parameters ( theValue type:#float ui:(mySlider, mySpinner) )

Here is the code, how can i do this in a rollout instead in an attribute holder using parameters?

rollout uiR "myRollout"
(
group "myGroup"
(
slider mySlider "" range: [0,100,1] type:#integer across:2
spinner mySpinner " " range: [0,100,1] fieldwidth:40 offset: [-100,6] type:#integer
)
)

try (closeRolloutFloater theRollout) catch ()
theRollout = newRolloutFloater "myRollout" 350 100
addRollout uiR theRollout

Thanks, and sorry for my awful english.

jonahhawk
10-18-2010, 12:31 AM
rollout uiR "myRollout"
(
group "myGroup"
(
slider mySlider "" range: [0,100,1] type:#integer across:2
spinner mySpinner " " range: [0,100,1] fieldwidth:40 offset: [-100,6] type:#integer
)

--Events
on mySlider changed arg do
(
mySpinner.value = arg
)

on mySpinner changed arg do
(
mySlider.value = arg
)
)

try (closeRolloutFloater theRollout) catch ()
theRollout = newRolloutFloater "myRollout" 350 100
addRollout uiR theRollout

ramirotell
10-18-2010, 12:52 AM
Thank you very Much!!, it works perfectly!!!

jonahhawk
10-18-2010, 02:50 AM
You bet. Take a good look at the MaxScript help for spinners/sliders and particularly the events.

CGTalk Moderation
10-18-2010, 02:50 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.