LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure with Event source: <This VI> and Event: Mouse Up

I downloaded an old example from 2008 on this forum and would like to duplicate it.  It uses an event structure with an event case of just Mouse Up.  Under Event Specifiers:  the Event Source is <This VI>  and Event: Mouse Up.  This works like I want in LV 2009.

 

In LV 2009 if I choose for Event Source  <This VI>   under Events Mouse Up is not an option!    I tried Event Source: Pane,  and  then Event  Mouse Up is an option, but this does not trigger the event if you drag the mouse off the pane before you lift the mouse button.

 

I can copy the Event Structure over to my VI  and rewire every case but that does not seem to be a good solution cuz I want this in several VIs.

 

I have attached the original VI with the Event Specifier I want.  How do I get this Event Specifier in LV 2009?

Message 1 of 26
(5,513 Views)

@phillman wrote:

I downloaded an old example from 2008 on this forum and would like to duplicate it.  It uses an event structure with an event case of just Mouse Up.  Under Event Specifiers:  the Event Source is <This VI>  and Event: Mouse Up.  This works like I want in LV 2009.

 

In LV 2009 if I choose for Event Source  <This VI>   under Events Mouse Up is not an option!    I tried Event Source: Pane,  and  then Event  Mouse Up is an option, but this does not trigger the event if you drag the mouse off the pane before you lift the mouse button.

 

I can copy the Event Structure over to my VI  and rewire every case but that does not seem to be a good solution cuz I want this in several VIs.

 

I have attached the original VI with the Event Specifier I want.  How do I get this Event Specifier in LV 2009?


huh? Are you saying it runs in the already created code, but when you try to create a new event structure the option isn't there?

0 Kudos
Message 2 of 26
(5,507 Views)

 


@phillman wrote:

I downloaded an old example from 2008 on this forum and would like to duplicate it.  It uses an event structure with an event case of just Mouse Up.  Under Event Specifiers:  the Event Source is <This VI>  and Event: Mouse Up.  This works like I want in LV 2009.

 

In LV 2009 if I choose for Event Source  <This VI>   under Events Mouse Up is not an option!    I tried Event Source: Pane,  and  then Event  Mouse Up is an option, but this does not trigger the event if you drag the mouse off the pane before you lift the mouse button.

 

 


 

So what you can do is monitor the 'Mouse Leave' event for th pane, and then start polling the mouse state.

Technically it is correct that there is no Mouse Up event detected since the Mouse Up is not happening on th epane.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 26
(5,502 Views)

They have just been moved to Panes>>Pane from <This VI> I believe.  Since your VI has only a single pane, it behaves exactly the same.

Randall Pursley
0 Kudos
Message 4 of 26
(5,487 Views)

No they don't work the same!   The uploaded code works the way I want.  No matter where the mouse is the mouse up event is triggered.  Where as if I use Pane the mouse has to be in the pane. 

0 Kudos
Message 5 of 26
(5,481 Views)

 


@for(imstuck) wrote:

huh? Are you saying it runs in the already created code, but when you try to create a new event structure the option isn't there?


YES!  Try the uploaded code, then try to duplicate it from scratch!

 

0 Kudos
Message 6 of 26
(5,478 Views)

I see what your saying now.  The event is still part of the possible events in the event structure, but no longer user selectable in LV2009/2010.

 

I tried replacing it with the Mouse Leave event, and it works, but not exactly the same way as before either because the value updates as you leave, but the slider can still be changed until the mouse button is released.

 

I cannot see a combination that will result in the same behavior.  LabVIEW 8.6 did not have this option, but LabVIEW 7.1 did.  Somewhere in between it was changed.

Randall Pursley
0 Kudos
Message 7 of 26
(5,465 Views)

I am not sure if this topic is resolved in more recent versions than LV2012. Anyway: I would like to have the <This VI>:Mouse Up event again. Probably the functionality discussed here has simply been forgotten when this event has been migrated to the <Pane> events.  

See the attached VI for illustration.

 

In our application we open a lot of pop-up controls in small windows, and frequently one misses the mouse up event.

(Thanks for the polling work-around described above, perhaps we should try that although the native event would be much better)  

 

Copy/Pasting from an old, inherited Event structure works in principle, but is really impractical if one needs to rebuild an already existing complex Event structure.

 

Dirk

0 Kudos
Message 8 of 26
(4,850 Views)

Hi Dirk@LV,

 

I am confused of what functionality you are trying to achieve. Can you clarify what functionality you desire, and why this is problematic after LV 2012?

Best Regards,

Roel F.
Applications Engineer
National Instruments
0 Kudos
Message 9 of 26
(4,801 Views)

Hi Roel,

 

in older LV versions, the <This VI>:Mouse Up event allowed one to track Mouse Up and trigger some action in the special case that the cursor leaves the front panel area WHILE a slider or gauge control is being operated. This is very likely to happen for example in the case of a small pop-up window.

This is not to be confused with the <Pane> Mouse Leave event: you would not want that action (e.g. closing the panel)  being triggered while you still move the slider. It just should happen if you end your input, thus at Mouse Up.

 

A very similar problem may arise in some other situations, like context menues or ring controls: it seems that there is no event that allows one to track Mouse Up if you leave the control area and let go of the mouse. Using these controls is like leaving the pane, even if you are still over its area. The Mouse Up event then is not one the pane, so there is no access to it.

 

Dirk

0 Kudos
Message 10 of 26
(4,784 Views)