LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

picture control event

Solved!
Go to solution

Hi,

 

Ideally I like to have the situation of displaying a number of pen pictures in 2d picture indicators on my front panel. Then when one of the picture indicators is clicked/double clicked an event is triggered and handled accordingly.

 

As a picture indicator has no state i.e. true/false I can't use a change value event as I'd like to. So I'm wondering if anyone has any other neat suggestions to get the functionality I want i.e. where an event is triggered when one of the pictures is clicked/double clicked.

 

I've experiemented with mouse enter event but it's not really suitable for my application.

 

Strokes

0 Kudos
Message 1 of 7
(3,491 Views)

I don't know if you can take advantage of this, but check out the Mouse property node of a 2D picture.  (Right click on the picture, then click Create-Property Node-Mouse.  Then create an indicator for this property node.  The mouse position will be -1,-1 if the mouse is anywhere except the picture and will give you XY coordinates when the mouse is on the picture.  Also, the mouse button indicators are only active when the mouse cursor is on the picture.  So you might be able to use an event based on a value change on the mouse button on the picture.

Message 2 of 7
(3,483 Views)

simple example attached

Message 3 of 7
(3,477 Views)

@craigp wrote:

simple example attached


Any chance you could down convert to 2010?

0 Kudos
Message 4 of 7
(3,460 Views)
Solution
Accepted by topic author Strokes

Just use the double clicked tag from the mouse down event:

 

picture double click.png

_____________________________
- Cheers, Ed
Message 5 of 7
(3,452 Views)

.. and when you are rady to move on to an advanced use of the Pitcure Control and events, take at look at Ton's Event Registration Nugget where he taught us how to monitor events from a sub-VI.

 

What he showed us in that thread represents the core of most of my "On-the-Fly" GUIs where I use those techniques to make it look like there are controls on a GUI.

 

Have fun!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 7
(3,440 Views)

Here's a 2010 version.  I think the other answer you got using the event case should also work (and is simpler), but I'm posting this just in case it is helpful.

Message 7 of 7
(3,427 Views)