02-07-2012 07:49 AM
Hi Darin,
Yes, I was already aware of what you pointed out, and I have tried the same trick (looking at click position), but if my displayed value is in close proximity to a threshold, there are still instances where the displayed value gets moved rather than the threshold. I have not yet been able to overcome this problem. I hope that I can, because our customer really liked the pointers for setting thresholds.
02-07-2012 12:16 PM
Funny I have used this a few times and it works quite well. I assumed you shrank and moved the "invisible" pointer to a far-off location, greatly reduces the chances of accidentally hitting it. Just coloring it transparent leaves a relatively large strike zone. If you want it to be zero chance just put a transparent picture or something else over the top, or use the Mouse Down? filter event and toss out all clicks not in the 'MasterRect'. This Rect will only include the slide area, you may need to pad if the threshold pointers extend a bit above that. If you then put the invisible slider below the slide it is easy to toss the stray clicks.
In vi.lib\picture\PictureSupport.llb there is a VI called PointInRect.vi which does the job for you.
02-07-2012 01:53 PM
Darin,
We may have a disconnect as far as what I'm trying to do. If I move the 'invisible' pointer to a far-off location, the value goes along with it. The 'invisible' pointer is associated with the actual value I'm showing in the slider area. For instance, when the battery voltage (shown by the slider with the invisible pointer) reaches a threshold value, the threshold value is directly overlaid with the voltage value, and when I try to pick the pointer for the threshold I get the voltage slider instead.
If you have a working example of a slider that gets around this problem, I'd love to give it a try.
02-07-2012 02:18 PM
Here is a very quick example. I left the display pointer colored white so you can see where the dot moves.
02-07-2012 03:53 PM
Thanks for that, Darin - you've given me some new ideas. I'll need to make a custom control and move the voltage pointer down by the labels and make it invisible. Between that and some coordinate filtering, I think I can build a useable workaround.
02-07-2012 04:05 PM
Darin,
Where the heck is the MasterRect property? I can't seem to find it in the property list.
02-07-2012 04:31 PM
02-07-2012 04:37 PM
Aah... Thank you.
If I discard all mouse clicks with a vertical position greater than MasterRect.Top, I can limit the moving the threshold pointer to only clicking and dragging on it. Clicking in the slider area has no effect. This will work great now with the Silver control! Thanks for your help.
02-08-2012 08:07 AM
I figured I'd share what I ended up with. This will work well for me. The 'filled value' slider is the first slider, and its pointer is invisible and moved below the slider area. The next two sliders are the max/min sliders (interchangeable). I throw out all mouse down events that are in or below the bar area, so that only pointer grabs are active.
Attached VI is in LabVIEW 2010.
02-08-2012 09:05 AM
I just found a problem with what I posted if you closely stack the controls vertically. The 'filled value' slider's pointer should really be located within the slider area (and made transparent), not below it, so that there is no possibility of a control placed directly below another one to grab the invisible pointer.