View Full Version : Replacate Range slider with lscript

06-30-2011, 05:34 PM
Is it possible to replicate the range slider found in the Light Properties panel with lscript?

There's a ctl for distance and one for a mini-slider but not one that combines both.


06-30-2011, 06:23 PM
Yes, with some trickery or limitations.

For the trick, search the lscript forum (keyword minislider should suffice). Someone presented a solution there combining two controls, I believe it was the ctlpercent minislider and a ctldistance field.

For the limited version, draw yourself a minislider and process mouseevents. The reason this is limited is because the lscript mouse listener doesn't provide coordinates or mouse movements relative to the mouse click, but only absolute coordinates (relative to panel). Essentially this means you cannot track mouse movement beyond the screen. So a user could only drag the slider to the edge of the screen, then he'd have to release the mouse and drag again. An unnecessary and unfortunate design flaw in Lscripts mouse event system. There should be dx and dy for reqmousemove!

In this case, the trick is the best and only solution for the other is just annoying to use.

06-30-2011, 07:23 PM
Thx. I'll check it out.