LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Context menu with Dynamic Event and Array element

Solved!
Go to solution

Hello, I'm experimenting for the first time with customizing my context menu (right click on a numeric variable).

In the specific I am trying to add a context menu to a numeric control that is inside an array (actually in a array of clusters, but I can reproduce the "problem" also in the simplified way that I'm attaching here).

I can trigger the event "context menu activate" with the reference of my element, but I can't trigger the event "Context Menu Selection" on my custom element. Why? What am I doing wrong?

The event must be catched by the dynamic event registration because the VIs where I want to implement this feature are quite complicated and also for scalability reason (the idea is to scan all the elements in the VI, included array elements and cluster elements, in order to have the reference of all the numeric controls in the VI)

Thank you for the help.

0 Kudos
Message 1 of 13
(3,692 Views)

Interesting.  Seems to be a bug.

 

Where I am unsure is which part is a bug. The fact that the Menu activation works on an Array Element actually surprises me, but if that works, then I suppose the menu selection should also.  But I see the same behaviour you describe.  Doesn't feel right to me at all.  Report it as a bug and see what NI tells you.

 

Shane

0 Kudos
Message 2 of 13
(3,669 Views)

Try inserting a "Delete" Menu Items before the custom menu. It seems to work then.

 

mcduff

Add delete menu itemsAdd delete menu items

 

 

 

0 Kudos
Message 3 of 13
(3,661 Views)

Do you mean like this (see version attached)? It doesn't change anything to me (LV 2015 SP1)

0 Kudos
Message 4 of 13
(3,640 Views)

So far i've not succeded with your file either, i added a fixed Menu selection event and that works fine ... Hmm, this reminds me of an old issue, i'll test for it.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 13
(3,636 Views)

@cassaniti wrote:

Hello, I'm experimenting for the first time with customizing my context menu (right click on a numeric variable).

In the specific I am trying to add a context menu to a numeric control that is inside an array (actually in a array of clusters, but I can reproduce the "problem" also in the simplified way that I'm attaching here).

I can trigger the event "context menu activate" with the reference of my element, but I can't trigger the event "Context Menu Selection" on my custom element. Why? What am I doing wrong?

The event must be catched by the dynamic event registration because the VIs where I want to implement this feature are quite complicated and also for scalability reason (the idea is to scan all the elements in the VI, included array elements and cluster elements, in order to have the reference of all the numeric controls in the VI)

Thank you for the help.



This should answer all topics in your post, Context menu 2 nested deep and all Cluster and Array references 3 nested deep.

 

Main VI is "ContextMenu.vi" in Zip Folder.

0 Kudos
Message 6 of 13
(3,623 Views)

@Jasch wrote:

This should answer all topics in your post, Context menu 2 nested deep and all Cluster and Array references 3 nested deep.

 


Maybe I'm a bit super slow today, but what exactly are you answering here?

0 Kudos
Message 7 of 13
(3,618 Views)

Sorry but I also don't get it. I expect a PopUp when I click on my custom menu. I don't see that happen in your VI. Or am I wrong?

0 Kudos
Message 8 of 13
(3,614 Views)

simplified solution, has all pop up click answers.

0 Kudos
Message 9 of 13
(3,610 Views)

i know it works with the whole array.. the fact is that i need it only on the digital element like in the example that I attach you here.. that is not working for me....

0 Kudos
Message 10 of 13
(3,604 Views)