LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
altenbach

Mouse events on 2D pictures should have an event data node for mouse information

Status: New

A very common task when operating with 2D pictures are mouse down/move events where we are interested which pixel was just clicked. While there is an event data node for the clicked coordinates these are relative to the front panel and translating them into image pixel coordinates is a chore and requires jumping through flaming hoops tweaks. (i.e. label yes/no? zoom factor? etc.)

 

However, there is a "Mouse" property for 2D images that has all the information directly in pixel coordinates and mouse button states. Currently, we need to read that property inside the mouse event to easily get the information we always (always!!!) want in such an event!

 

It would be cleaner if mouse events on pictures would output these mouse properties directly as an additional event data node.

 

Two clear advantages:

 

  • Cleaner code for those who know how to work with this property.
  • Stop sending newbies on a snipe hunt trying to figure out how to translate the current "coords" event data node into something useful for the intended task.

Here is an example where this idea would have helped

 

Here's a picture for the graphical thinkers!

 

altenbach_0-1748105937806.png

 

Thanks for voting!

 

 

 

 

 

3 Comments
crossrulz
Knight of NI

Something else to add to my list for cleaning up the Icon Editor...


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
altenbach
Knight of NI

Here is another example where the idea would have simplified things.

 

altenbach_0-1747321804094.png

raphschru
Active Participant

Just giving my 2 cents here:

 

I think that, by implementation in LabVIEW, any UI event of a given VI Server class is never overridden when the actual class is more specific. I don't say this is impossible to implement by NI, just that the override mechanism may not even exist.

 

Concretely, since "Mouse Move" and "Mouse Down" are generic Control events, it may not even be possible to have an additional event data that is specific to Picture controls.

 

This limitation may explain why sometimes specific event data are only available through property nodes instead of event data nodes.

 

So the proposed idea would require either to:

 - Add such override mechanism for UI events, raising lots of other issues (like what happens when multiple controls of different classes are linked to the same event case, or are dynamically registered as an array of references, ...);

 - Or add brand new events that are specific to Picture controls: "Mouse Move on Picture", "Mouse Down on Picture", "Mouse Up on Picture", etc. Quite redundant!

 - Or only override the value of the existing "Coords" event data, but then you would lose the front panel coordinates that are useful for generic mouse handling, and that would be inconsistent with other control classes.

 

Regards,

Raphaël.