10-22-2012 11:08 AM
This may be a weird question, I would like to disable programmatically the run-time menu of a graph. but only when a user double clicks it with the right mouse button (button 2) and give some functionality to this mouse-button-2-double-click. For those who never saw this, Google Maps uses this to give an option for a fast zoom out by mouse as zooming in is done by double-clicking with the left mouse button (button1).
I added a vi with graph to play around. If I have there the run-time menu enabled, the mouse-button-2-double-click seems not possible, only if I disable the run-time menu. But I would like to handle this programmatically of course. Is there a way in the Mouse Down, the Mouse Down filter event, in the "Shortcut Menu Activation?" or somehow else? Any ideas to handle this?
10-23-2012 02:25 AM
I should have thought about this topic in the morning with fresh mind... Just discard the MouseDown in its filter event and through a local variable disable the Run Time Menu Activation.
10-23-2012 03:51 AM
Well I thought it's good... but now as I discard every first mouse click, there's no more popping up of the the Run Time Menu when it's only one right click. Hm...?
10-23-2012 04:12 AM
Hm, i cannot recall any Windows software which has functionality bound to a double click with the right mouse button. They only "trigger" on a double click with left mouse button.
Is there any specific reason for this? Wouldn't it be easier to e.g. use a "Ctrl+left click" for the desired functionality?
just some thoughts,
10-23-2012 06:03 AM
Hello Norbert, Google Maps has this functionality. I am implementing some additional key and mouse functionality to a graph and wanted to implement "standard", common behavior. Google Maps seems to me one of the most used "Graphs" in the world. Your suggestion with Ctrl+ double-click is in fact used for Google Maps on Mac, that would be my other option, but I first thought to look if the right double-click isn't possible.
About Google Maps: ...
- Double-click to zoom functionality - Double left-click to zoom in, and double right-click to zoom out (Ctrl+ double-click for Mac users). ...
From the page: http://support.google.com/maps/bin/answer.py?hl=en&answer=7060
10-23-2012 06:30 AM
Hm, ok, i never used that right-double click feature at google maps...
Well, you CAN implement something like this, but it is somehow worksome.
The reason: You would have to deactivate the context/right click menu completly and replace it by a custom written popup-VI which is called if you perform a single right click.
See attached example for a general guidance.
10-23-2012 08:36 AM
Thanks a lot Norbert for your solution! That could be something, but yes indeed a bit more work, especially as I want to use it on quite some graphs. So I guess for the moment I'll go with the Ctrl+LeftDoubleClick.
(attached your vi in LV2011 if somebody has no LV2012 installed yet like me...)