From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

deactivate "insert element before / remove element" in array

Solved!
Go to solution

Hello guys.

It is possible to deacitvate "insert element before / remove element" function appears after right-click on a array in the frontpanel?

 

"Description and Tip" should stay.

 

Thank you.

 

Alex

0 Kudos
Message 1 of 12
(4,743 Views)

What do you mean explain with example. or explain properly....

 

<<Kudos are welcome>>

0 Kudos
Message 2 of 12
(4,738 Views)

In the program I use arrays, where the user can fill in different information

(for example a 1D-String array with different names)

the problem is, that the user can click on the array in frontpanel (right mouse button) and delete or add an or more elements

and the program would work in this case not correctly.

 

I know, the "normal" user would't do it, but, who knows 😄 😄

 

Thanks.

 

 

0 Kudos
Message 3 of 12
(4,723 Views)

Open the VI properties (Ctrl + I). Goto window appearence category & uncheck the "Allow default run-time shortcut menus" option.

 

-Kumar.B

 

Message 4 of 12
(4,715 Views)

Thank you for your solution,

unfortunatly the "description and tip" will not work in this case

but I need it, because the user can read then, what exactly the buttons do.

 

Cheers

0 Kudos
Message 5 of 12
(4,687 Views)

A couple of thoughts.  First, have you considered a cluster for the Front Panel Control if the number of elements is fixed?  On the Block Diagram you can drop a Cluster to Array and carry on exactly as you did before.

 

As an alternative, you can create an Event Structure and add the ShortcutMenuSelection(app)? event for the array control (spelling is from memory, but definitely choose the filter event with the '?').  The ItemTag event terminal will have a string with the selected menu item, feed this into a case structure and for the two cases Insert and Delete wire a True constant out to the Discard Terminal of the Event Structure.  You will need to use a probe or temporary indicator to get the proper tags.  I am not a huge fan of this solution, it is relatively simple and effective, but it is a bit annoying to have a selection available to you and not be able to use it (IMO).  You could add a 'ding' or flash a message when the user tries this if you like.

0 Kudos
Message 6 of 12
(4,664 Views)
Solution
Accepted by topic author alexphysiker

You can customize the right-click shortcut menu to remove some application items and keep others:

 

Right-click on the array (and not on the array element!) in the front panel and select Advanced->Run-Time Shortcut Menu->Edit...

 

This brings up the Shortcut Menu Editor:

 

 Change the drop-down control from "Default" to "Custom".

 Select the "???" line in the tree control on the left.

 on the right, change the Item Type from "User Item" to "Application Item -> Description and Tip..."

 It will automatically fill in the corrent Name and Tag.

 

 Save the rtm either into its own file or into the control.

 LV will automatically handle application items in the control, no event case needed.

 

 I sometimes find the "Copy entire menu" function of the shortcut menu pretty useful if I only want to disable a few items.

 

http://zone.ni.com/reference/en-XX/help/371361G-01/lvconcepts/customizing_vis/#Customizing_Menus

 

-Barrett
CLD
0 Kudos
Message 7 of 12
(4,650 Views)
Ah, if all you want is 'Description & Tip' then blawson's tip should work. I have always had bad mojo customizing array menus, since in "normal" operation the right-click menu for an element is different than that of the array. I get oddities like Empty Array showing up when I right-click an element but then not working. Maybe my memory is sketchy, I don't have LV to play with now.
0 Kudos
Message 8 of 12
(4,640 Views)

Thank you guys for your time and solutions.

 

A special thank @blawson

it is exactly, what I wanted.

 

Cheers: Alex

0 Kudos
Message 9 of 12
(4,602 Views)

Hello all,

 

Darin brings up a sore point I'm also wondering about: the run-time right-click menu for array elements is different than the one for full arrays, and I haven't been able to figure out how to edit the array element run-time menu (during development, array elements do not have customizable right-click menus accesible via Advanced/). For example, if you right-click on an element during run-time, you get a menu that includes insert/delete row and insert/delete column. If you right-click on the array index or boundary, you get a menu that includes empty array, show selection, etc. In my program users do not see the index or boundary and only right-click on the array elements (I don't want them to see the full array menu, most of which is very confusing). I would like to keep insert/delete row, but hide insert/delete column. If I try to customize the menu, the only application items available are those from the full array menu which do not include array element insert/delete operations. Sure, I could create a completely custom menu and handle these operations on my own, but it would surely be nicer to have them handled by LabView, since they are already in there somewhere... if we could just get to them.

 

best,

Dan

0 Kudos
Message 10 of 12
(4,116 Views)