LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to limit the movement of free cursor

A cursor with free mode is put on the plot of the x-y graph(both x and y starts from 0 to its maximum scope). When the user drags the cursor, the cursor could either move across the zero point to the negative on the left or over the maximum on the right.

How do I limit the dragging between 0 and the maximum of x or y axis ? I am an newbie and will appreciate of telling me which property of cursor is used for this ?

0 Kudos
Message 1 of 3
(1,501 Views)

Right-click the graph and go to "advanced" and uncheck "cursors scroll graph".

 

altenbach_0-1630392230043.png

 

0 Kudos
Message 2 of 3
(1,494 Views)

@rqin wrote:

A cursor with free mode is put on the plot of the x-y graph(both x and y starts from 0 to its maximum scope). When the user drags the cursor, the cursor could either move across the zero point to the negative on the left or over the maximum on the right.

How do I limit the dragging between 0 and the maximum of x or y axis ? I am an newbie and will appreciate of telling me which property of cursor is used for this ?


Disabling the scrolling is probably what you want.

 

If you really want to limit cursor range, you can catch the Cursor Move event, and write the clipped cursor position:

 

Clip Cursor.PNG

 

Things will look ugly, as the clip happens after the fact. So, the scales will still move automatically.

 

You can work around that too, by making a dummy cursor, dummy scales, and synchronize them. If done correctly, the user won't know any better, but it's a lot of code...

 

The benefit is that you can clip to arbitrary ranges (or even arbitrary shapes). The clipping logic is separated from the scale.

0 Kudos
Message 3 of 3
(1,466 Views)