LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable a graphs run-time menu when user double clicks with the right mouse button (button 2)

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?

0 Kudos
Message 1 of 7
(2,473 Views)

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. 

0 Kudos
Message 2 of 7
(2,456 Views)

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...?

0 Kudos
Message 3 of 7
(2,445 Views)

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,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 7
(2,439 Views)

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

0 Kudos
Message 5 of 7
(2,429 Views)

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.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 7
(2,422 Views)

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...)

0 Kudos
Message 7 of 7
(2,413 Views)