LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Customize array shortcut "Insert Element Before",can't find it.

Hi

I have a qusetion when I want to operate on array like below.

I want to customize the name of the shortcuts "Insert Element before" and "Delete Element",but these two menus are not like others that they can't be found in the "Run Time shortcut Menu" editor.

Maybe I can do it in a complicated way that I get the mouse click position and insert a menu programaticly.Other than that is there a simple way to make it happen?

Thanks,

array shortcut.png

Message 1 of 6
(3,500 Views)

Hmm, actually this is an interesting problem. I think you see this difference because when you are in the Runtime Shortcut Menu Editor, you can edit the entries for the entire Array, but not for a single numeric control. DURING runtime, when you right click onto a single element inside the array, you get the Shortcut entries of THIS particular control.

Hmm, I am not sure if this is 100% correct what I wrote, anyway, I have found some more info regarding to this topic:

http://forums.ni.com/t5/LabVIEW/array-shortcut-menu-LV8/m-p/319930

http://forums.ni.com/t5/LabVIEW/deactivate-quot-insert-element-before-remove-element-quot-in/m-p/191...

 

edit: by the way, what I wrote above (part of it) does not make too much sense, since a single Numeric Control does not have those entries. I think this is a kind of feature/bug of the Arrays???

0 Kudos
Message 2 of 6
(3,469 Views)

I tried the trick described here:

http://forums.ni.com/t5/LabVIEW/array-shortcut-menu-LV8/m-p/1792504/highlight/true#M619502

 

Unfortunately, I get the same behaviour as in the reply in the following post:

http://forums.ni.com/t5/LabVIEW/array-shortcut-menu-LV8/m-p/1967435/highlight/true#M651877

 

I wonder, is this an intended behaviour, or a bug? So we cannot use a built-in ItemTag with a modified custom "Item Name", since the Item Name defaults back to the default? 🙂 I still see this in LV2015 SP1 and also in LV2016.

Actually LV throws me a warning window, I guess it complains about I use a restricted name for a built-in ItemTag?? No idea about the internal work of these menu things...

 

EDIT: Either selecting "yes" or "no" for the "Auto generate tags?" question, I get the same result...

 

nonvalidtags.png

 

Message 3 of 6
(3,456 Views)

That is the case,seems not much we can do about it.

So how to do it manually?How to activate a customized shortcut with "Insert" and "Delete" options for an array control?

I tried to do it in a Event Case structure,but the problem is unable to locate the element of the array.I don't know which element I'm clicking on it.

 

Any ideas?

0 Kudos
Message 4 of 6
(3,442 Views)

@avater wrote:

That is the case,seems not much we can do about it.

So how to do it manually?How to activate a customized shortcut with "Insert" and "Delete" options for an array control?

I tried to do it in a Event Case structure,but the problem is unable to locate the element of the array.I don't know which element I'm clicking on it.

 

Any ideas?


I refer to this post, and I used the subVI attached there for my example VI:

 

Test_array_item_index_clicked_BD.png

 

Download All
0 Kudos
Message 5 of 6
(3,427 Views)

Hi guys,

 

since this problem comes up over and over again, and NI does not seem to care (the issue is known since 2006 at least...) I thought it a good idea to share my solution (see attached VI).

 

The idea is to prepare the shortcut menu in a way where all necessary items are available, and then filter the items depending on where the click occured: the array frame or an element. Moreover, the desired behaviour is then achived by handling certain application items explicitely.

 

Hope that helps!

Message 6 of 6
(2,495 Views)