09-15-2011 05:30 AM
Hi,
Sorry if this seems like a silly question but I'm new to this!
Basically I have a plot that I want the user to be able to zoom into to examine a small section and then be able to click a "Reset Zoom" command button in order to go back to the original view.
I'm fine with the initial zooming bit, however resetting the zoom to the original is where I'm having problems. Can anyone please recommend the best way to go about this?
Many thanks
Solved! Go to Solution.
09-15-2011 05:51 AM
There are a couple of ways on how to do it:
09-15-2011 05:55 AM
One possibility could be to have a graph control callback with a test on EVENT_ZOOM; on the first occasion (after start or reset) you may use GetAxisScalingMode to obtain the minimum and maximum of the axis range.
In your Reset button callback you may then use these min/max values to restore the original axis range using SetAxisScalingMode.
Good luck, Wolfgang
09-15-2011 06:00 AM
Thanks for the help guys, will give it a try.
09-15-2011 07:22 AM
Also, is there any chance you know how to simulate holding the Ctrl key or if it's possible? I know you can use FakeKeystroke for a single key press but is there a way of setting a toggle switch so that while it's on it effectively holds Ctrl? I could only think of using a while loop but all that did was make it crash!
09-15-2011 12:16 PM
You can simply include the Ctrl key modifier in the FakeKeystroke call. For example, to simulate Ctrl+SpaceBar, your call would look like this:
FakeKeystroke (VAL_MENUKEY_MODIFIER | ' ');
Luis