LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ZOOM questions

Solved!
Go to solution

Hi,

 

  1. Is it possible to allow ZOOM_IN but to disable ZOOM_OUT? I don't want to get a graph with a larger than the inital range - I would rather prefer providing a 'reset zoom range' button instead of having the user zoom out repeatedly
  2. What triggers ZOOM_RESTORE (not mentioned in the help)? Obviously, Ctrl + SPACE does, but in the example GraphZooming also Ctrl + LeftClick seems to return this eventData1...?

Thanks!

0 Kudos
Message 1 of 5
(3,657 Views)
Solution
Accepted by topic author Wolfgang

1. No it is not possible to disable ZOOM_OUT, but not ZOOM_IN. You also cannot swallow the EVENT_ZOOM.

2. There is not a way to trigger ZOOM_RESTORE. The event is handled completely internal to the CVI RTE. You could store the original min and max for the axis ranges and restore these using SetCtrlAttribute( ) with an event on the graph or a separate button.

National Instruments
0 Kudos
Message 2 of 5
(3,648 Views)

Thank you!

 

Concerning my question 2 I have to be more precise: I do not want to trigger ZOOM_RESTORE, I want to know which action causes this event to appear. For example, pressing Ctrl + SPACE causes this event to be fired, but it appears to me that also Ctrl + LeftClick (without moving the mouse) may result in this event....? I am wondering if the latter is a correct observation?

0 Kudos
Message 3 of 5
(3,640 Views)

You are correct. There are 2 scenarios that the ZOOM_RESTORE event is triggered.

 

1. Pressing Ctrl + SPACE.

2. Ctrl + LeftClick while in Zoom to Rectangle mode, the mouse has not moved, and you do not have any zooms in the undo history. When doing a rectangle zoom, it creates a temporary undo record for the zoom in progress and must remove it if the zoom is not valid (no zoom region selected). If you have zooms in the undo history already (by that I mean you have already zoomed in at least once), then we have an easier way to remove this undo record, but if this is the first zoom, then we have to reset this record and we do that using the same routine as the ZOOM_RESTORE.

 

I think this behavior might be misleading if you are trying to catch the ZOOM_RESTORE event, so I have filed bug report 338093 and we will see if we can find a better way to handle this.

National Instruments
Message 4 of 5
(3,634 Views)

Thank you very much for confirmation and the detailed explanation!

0 Kudos
Message 5 of 5
(3,625 Views)