LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Allow user to change range of gauge with mouse

I am trying to figure out how to let the user change the range of a gauge by using the mouse. So they could click on the scale, and drag the mouse and it would increase or decrease the range.

I am trying to allow the user to "zoom" in the range on the gauge to get a better look at the reading, without having the user to clock on a control (using a numeric control that is tied to the range property node.)

I was thinking that you could possibly use the mouse move event when in the bounds of the gauge and whether they moved the mouse up or down would increase/decrease the range, but I thought that there must be a simplier way to implement this that I am missing.

Thanks.
Kenny

0 Kudos
Message 1 of 5
(3,237 Views)

Kenny K wrote:
I was thinking that you could possibly use the mouse move event when in the bounds of the gauge and whether they moved the mouse up or down would increase/decrease the range, but I thought that there must be a simplier way to implement this that I am missing.

I don't think there is a "simpler" way.

 

If you just want to temporarily "zoom" the scale into the region of the current value (e.g. to read the value more accurately or do a fine adjustment on the value), I sometimes use a "key down" event for the "ctrl" key on the control/indicator. When ctrl is pressed, the scale temporarily zooms e.g. to ±10% of the current value and releasing "ctrl" resets the scale to normal.

0 Kudos
Message 2 of 5
(3,226 Views)

I will have to use the key down in another program, thanks.

 

I wont be able to use it in this program, since it is a touchpanel pc, with no keyboard (other than the on screen keyboard, which is disabled), which is why I had to use the mouse Smiley Sad

Kenny

0 Kudos
Message 3 of 5
(3,221 Views)
You could add a slider control next to the gauge, which changes the scale property node of the gauge?
_____________________________
- Cheers, Ed
0 Kudos
Message 4 of 5
(3,214 Views)

You could edit the Run time short-cut menu and add an item "range"

 

Then create an event for the guage "Shortcut Menu Selection (user)".

 

In run time the user can right-click and choose range which will fire the above mentioned event. In that event present a pop-up to the user and let them specify the range.

 

I hope that helps,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 5
(3,205 Views)