LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Disabling Shortcut menu items - not possible in nested arrays?

Solved!
Go to solution

LV2018SP1

 

Looks like a LV bug, but maybe I'm missing something.

ON SCREEN:

   A Cluster containing an array of clusters, each of which contains an array of clusters.

A mockup for test purposes is attached.

In the real program the INDEX DISPLAY for the arrays will be hidden, and controlled by the sliders attached.

 

I NEED:

  To disable or amend the SHORTCUT menu associated with the arrays (both of them) so that the user is not able to affect the number of elements in the array via that menu. (In the real world there are other methods for that, which get fouled up if the shortcuts work).

 

PROBLEM: I can do it for the BOOKS array, by choosing (in the typedef) ADVANCED - RUNTIME SHORTCUT MENU - DISABLE.

But that option is not available for the CHAPTERS array, in the BOOK typedef.

I can disable it in the CHAPTER typedef, but that has NO EFFECT. It's seemingly not passed down to the container.

 

Even if I disconnect everything from typedefs (which I don't want to do), there is no way to disable it for the CHAPTERS array.

 

The VI and Typedefs are attached - make it work, I dare you.

 

(Maybe it's fixed in LV2019+)

 

ShortCut Test.PNG

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 1 of 10
(2,781 Views)

I am still running 2012 and I had to recreate the cluster since I couldn't open your file.  But I see the same thing as you. 

I do see something strange.  When I right click the Chapters array and open Advanced menu, I have two options for the Customize selection, one of them being disabled. I wonder if this is somehow related to your issue, that one of these should be the Shortcut Menu options? 

aputman_0-1596119194158.png

 

aputman
0 Kudos
Message 2 of 10
(2,753 Views)

You may need to programmatically handle the disabling of right-click context menus instead.

Register for right-click menu activation events, and ignore the event based on the control type as needed.

See here.

Using Labview 2022, Windows 10
0 Kudos
Message 3 of 10
(2,733 Views)

I have two options for the Customize selection, one of them being disabled.

 

I've seen THREE items for Customize, with two disabled.  The one that's enabled amounts to an OPEN TYPE DEF operation.

 

I think this is just the levels of nesting.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 10
(2,725 Views)

In LabVIEW 2020 I can get it to work.

  1. Change all strict type defs to normal type defs.
  2. In library Cluster on your VI not type def, right click and disable menu.

Snap37.png

 

When that is done, I can right click the arrays and have nothing appear.

 

Not sure if you want the cluster menu gone or not.

 

mcduff

Message 5 of 10
(2,689 Views)

I only have 2017 installed on my work computer, but I bet a couple of those type defs are of the strict variety... and what do we know about strict type defs? You can't change their properties unless you open the type def file and change stuff from there! Either change to regular type def and you can toggle the shortcut activation of the type defs in the main VI, or open each strict type def and change the property from there.

 

But... is there anything you need run-time shortcut menus for? If not, your solution is quite simple:

VI Properties -> Window Appearance -> Customize... -> uncheck box for "Allow default run-time shortcut menus"

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

Message 6 of 10
(2,677 Views)

In LabVIEW 2020 I can get it to work.

 

  1. Change all strict type defs to normal type defs.
  2. In library Cluster on your VI not type def, right click and disable menu.

 

Does NOT work for me in LV2018.

I did #1.

Here is the status of #2:

Pic 1.PNG

 

Here is the result.Pic 2.PNG

 

 

Ideally, I'd like to keep the CUT DATA/COPY DATA/PASTE DATE options intact.

But I'll take what I can get as far as not being able to "cheat".

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 7 of 10
(2,659 Views)

I bet a couple of those type defs are of the strict variety

 

As I said, even if I disconnect everything from its TypeDef, the problem is still there.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 8 of 10
(2,657 Views)
Solution
Accepted by topic author CoastalMaineBird

OK, I have solved this.  Not sure why the basic instinctual method doesn't work but this does.

 

1... Go to the low-level (Chapter) TypeDef.

2... Enable the RTS menu (Run Time Shortcut)

3... Edit the RTS menu

4... Copy the entire menu.

5... Switch to CUSTOM.

6... Paste  (This makes the custom menu identical to the standard).

7... Delete the items I don't want.

8... Save the menu with the control.

9... Make the typedef STRICT, long enough to  APPLY CHANGES, then Non-strict.

10... Repeat 1-9 for the Book typedef.

 

Now it uses the custom menu - I have the functions I want, and not the ones I don't.

 

Thanks to all who contributed.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 9 of 10
(2,651 Views)

Can you say, "U-G-L-Y"?  I knew you could...

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 10
(2,628 Views)