PDA

View Full Version : Using sliders



avid
December 14th, 2003, 01:20 AM
My CCF does not yet use any sliders, but I can see the need to add some. However, trying to do this by inferring the rules from the posted samples is a bit tricky. So maybe someone could confirm or correct some assumptions and answer a few questions:

Assumption: A slider button must exist within a frame, which constrains its movement.
Assumption: A slider button has an ID tag, which is of the form: SLIDER:<variable name>,A,B,C,D
Assumption: changing the variable (e.g. via Girder feedback) will move the slider.
Question: What is the interpretation of A,B,C&D in the Id tag? Are the ranges defined by the particular variable?
Question: How is the variable's new value sent to the driver - which may be MC, Girder or my own? What is the enoding of the action? Is it driver-dependent?
Question: Is the value that is sent to the driver a position? A percentage? Or is it scaled to be in the variable's range?
Question: Is the value sent as the slider moves, or only when it is released?
Final question: Is this documented somewhere I could have found it?

Thanks

Brian

Ben S
December 14th, 2003, 02:58 PM
Hi Avid,
Your assumptions are correct.

As to your questions.

1) A = base value (start), B = min, C = max, D = granularity.

B & C can be swapped for a bottom to top (right to left) slider instead of
top to bottom (left to right). Granularity is how often it will send the update (change the value). This is to speed up performance. A max of 100 with granularity of 10 will let you set it to 0,10,20,30,40,50,60,70,80,90,100. Any smaller change does not "stick".

2) A plugin must "register" for changes to a value. For Girder, JRMC, etc. I've been using 0x9999, 0x9999 as the two parameters to say "Register for feedback". On button registration it will register for a callback on the specified value (The IR name is the value to "watch"). On button unregistration it will unregister the callback. That seems a little confusing when I put it down on "paper". I hope it's not.

3) It is the actual value. The value change "registration" is the same for whether it's set via NRBasic's toggle value, set value, increment value, etc. or via a slider.

4) While it moves. This should be ammended to send the actual value when you let go, too.

Final Question) Only in my notes, which have not been made available yet. And now here, to some degree.