LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Delete Annotation" Shortcut Menu event not registered?

I am trying to react to user actions on a XY Graph. In particular, I want to detect when the user adds or deletes an annotation.

I can detect the creation of an annotation and the deletion of ALL annotations using the "Shortcut Menu (App)" event.

However, when the user selects a specific annotation and use the "Delete Annotation" shortcut menu item, it is not detected as a "Shortcut Menu (App)" event (or (User) for that matter).

Am I doing something wrong or is this a bug?

LV 2011, Windows XP.

0 Kudos
Message 1 of 8
(2,795 Views)

Another related question is: what event do I need to monitor to detect a change of plot name? I would have assumed that this would be comprised in the "Plot Attribute Change" event, but it appears not to.

And yet another is: how do I detect changes to the scale style (log/linear, precision, etc...). The only events that I can see are "Scale Range Change" and "Autoscale Range Change".

0 Kudos
Message 2 of 8
(2,791 Views)

I believe you are right that delete annotation will not show up in the shortcut menu events.  I would suggest using the Annotation List property node of the XY Graph.  It returns an array of annotations.  It may be easier for you to monitor this array to show when one has been deleted rather than trying to use the shortcut menu which I don't believe will work for a single annotation being deleted.  

Regards,

Eric L.
Applications Engineering Specialist
National Instruments
0 Kudos
Message 3 of 8
(2,753 Views)

Eric,

 

I am trying to avoid polling the list and therefore I would prefer to have an event telling me when the users creates, deletes or moves an annotation.

0 Kudos
Message 4 of 8
(2,749 Views)

Hello,

 

If you don't want to poll the array of annotations.  You could use the value change event for the array of annotations in your event structure, and it should be triggered whenever something is added or removed.

 

I would create an indicator for the annotation list from the XYGraph property node.  Set the indicator's visible attribute to false, and add a value change event for the annotation list indicator in your event structure.

 

Regards,

Matt M.

Applications Engineer
National Instruments
0 Kudos
Message 5 of 8
(2,742 Views)

Matt, would you mind elaborating? I don't see how your approach is solving my problem (if I understand it correctly).

There is currently no event attached to the annotation list. How am I supposed to update an "indicator" with the annotation list without polling it?

Let me be clear: I am NOT looking for a WORKAROUND. I am just checking that I am not missing something obvious. Apparently I am not, since none of the LV experts have chipped in.

If there is no solution, I will just move ahead and suggest adding this kind of events to the graph objects.

0 Kudos
Message 6 of 8
(2,737 Views)

I don't know if there would be a performace hit doing it this way.  I have attached an image of my solution.

 

EDIT: I just realized there is an oldval and newval in the event structure which makes this much simpler.  I have uploaded a new image showing what I mean. 

 

Regards,

Matt M.

 

 

Applications Engineer
National Instruments
0 Kudos
Message 7 of 8
(2,734 Views)

For those who understand the dire need for an "Annotation Changed" event, please go ahead and kudo this idea (not mine, but frustrated LV users meet).

0 Kudos
Message 8 of 8
(2,726 Views)