11-25-2009 12:31 PM
I've got a stumper here:
I have a numeric slider control that I want to snap back to 0 when the user releases the mouse button when sliding the control - sort of a physical joystick response where the stick goes back to the center when released.
I'm able to make this partially work by handling the mouse up event and setting the control value to 0. But the mouse up event never occurs if the user drags the slider control and leaves the slider control boundaries - and releases the mouse when the pointer is off the control. In this case, the slider value is retained and the mouse up event never occurs with respect to the numeric slider.
Any help is appreciated.
Al
Solved! Go to Solution.
11-25-2009 12:42 PM
11-25-2009 12:44 PM - edited 11-25-2009 12:45 PM
11-25-2009 12:51 PM - edited 11-25-2009 12:52 PM
Is this a workaround to your problem?
Edit: Two beats me, but I had to wire some stuff 😉
11-25-2009 01:03 PM - edited 11-25-2009 01:04 PM
11-25-2009 01:29 PM
elset191 wrote:
I also made an example to make sure what I was saying was correct, though I didn't attach it. I will now to offer another perspective.Message Edited by elset191 on 11-25-2009 01:04 PM
Elset-
Nice except for the one issue. You should initiallize the Flag SR True. If the VI exits with a False flag you miss the first mouse down event
11-25-2009 01:39 PM
11-25-2009 01:47 PM
elset191 wrote:
I did forget to initialize the SR. However I would be inclined to initialize it with F. I played around and couldn't find any cases that differed no matter if it was left uninitialized, or initialized to either true or false.
You right- init with false.
Test case: set slider off zero before running.
With Init F mouse ups on the FP (not on slider) cause no reset.
With Init T mouse ups on the FP (not on slider) cause slider reset.
OP
What is the desired behavior? should slider be set to zero before the loop runs?
11-25-2009 02:16 PM
You cats are awesome! The solutions work like a champ.
Thanks again for the quick responses!
Al
03-19-2010 04:28 PM
This post helped me identify my problem, so I thought I would post my solution.
The above works just fine until the user drifts off of the LabVIEW pane altogether. Check out how I got around this in the Developer Zone Community.