09-24-2011 05:09 PM - edited 09-24-2011 05:15 PM
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.
09-24-2011 06:04 PM - edited 09-24-2011 06:08 PM
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".
09-26-2011 04:40 PM
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.
09-26-2011 04:53 PM
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.
09-27-2011 10:27 AM - edited 09-27-2011 10:32 AM
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.
09-27-2011 11:03 AM
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.
09-27-2011 11:15 AM - edited 09-27-2011 11:20 AM
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.
09-27-2011 11:33 AM
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).