Jump to content

Get slide value from mouse co-ordinate?


Recommended Posts

Does anyone know if there's a way to get the value of a position along a slide control based on mouse co-ordinates? 

 

For example, the waveform graph has an invoke node which will "Map Coords to XY" I'm after a similar functionality but for a slide control so that I can either prevent unwanted clicks in a certain region of the slider (i.e. I have a 2 slide control and want to either filter out any clicks that fall outside of the region between the sliders, or switch the active slider to be the one closest to the click before the click is processed). 

 

I put a slightly more detailed (complicated?) description over or NI.com (http://bit.ly/1l1iJr6) but haven't had a response yet, just wondered if anyone on here might have some ideas? 

 

I've have managed a bit of a workaround by cobbling together the co-ordinate of the mouse with some bounding box info on the scale and housing of the control and prior knowledge of the scale range, but I just thought that, at least under the hood labview is doing what I want, is there a way I can access it?!

 

Thanks

 

Paul

Link to post
Share on other sites

I'm finding a property (LV 2012) called "Housing Size" that could be used with the position to determine the slider area versus the scale area. I don't see an equivalent method to map the click coordinates to a numeric value.

Link to post
Share on other sites
I'm finding a property (LV 2012) called "Housing Size" that could be used with the position to determine the slider area versus the scale area. I don't see an equivalent method to map the click coordinates to a numeric value.

This is the only thing I can think of that would work as well but it probably is very error prone.  Lets say your control size is 100px high according to the Housing Size property. That will likely include the borders, and any small spaces around the slider, and possibly things like the label/caption and digital display.  These things will need to be taken into account and the range from min to max on the control and may not be very accurate.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.