LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble customizing the EDIT menu

LV2013 SP1, Win7

 

I have an app with 10+ windows.  They are non-modal, meaning the user can show, hide, and layer them at will.

 

They all have the same basic menu, with here and there one window has some custom items.

 

I generate the menu in code, when the window starts running, by trashing the existing menu and starting from scratch.

 

Since I have to customize anyway, using RTM files doesn't benefit me.  I use the same VI to build every menu for every window, then a custom VI to tack on or change whatever is peculiar to this one window.

 

The EDIT menu is somehow magic; I have found no HELP text that explains this behavior.

 

All I have to do is insert an item called "Edit" in the menu, and I get a full menu with CUT, COPY, and PASTE, complete with shortcuts.

 

I don't create those items, I don't attach shortcuts,  I don't VALIDATE them (at ACTIVATION? time), and I don't handle the tags at SELECTION time.

 

Great.  They get validated (Enabled / disabled based on conditions) and they work just fine.

 

Now, I have a window where I want to customize the EDIT menu. 

 

I want to keep all the CCP behavior, but add a dividing line and a few custom items.

 

If I do the INSERT ITEMS where I regularly build the menu, then my custom items end up FIRST, and the CCP ends up below them.  I don't want that.

 

I don't usually use the INSERT AFTER terminal, but even if I specifically ask for my items to be last (INSERT AFTER = 9999) or INSERT AFTER = "APP_PASTE", it just doesn't care.  It comes out with CCP at the end.

 

It's as if the items don't really exist yet, until VALIDATION time.

 

So, in my VALIDATION code (called at MENU ACTIIVATION? time), I add the menu there.

 

Sure enough, it comes out the way I want.  The CCP items are first, and my items are below.

 

But the NEXT time I click the menu, there are TWO copies of my items.  The NEXT time, there are THREE.

 

So, am I supposed to keep track of "Have I added my items already" and add them or not in the ACTIVATION? code?

 

Am I supposed to trash the whole EDIT menu and add them again?

 

Or is it easier just to have the EDIT MENU part of my items and build it as just another menu?

 

Where are the rules for this explained?

 

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 3
(2,826 Views)

Hi Steve,

 

Can you post a screenshot of the part of the code where you are customizing the edit menu? That may help show where the issue may be.

 

Thanks,

Lauren

0 Kudos
Message 2 of 3
(2,748 Views)

Well, I've moved on now.  It's a PITA to recreate the offending code.

 

I just wish I could find documentation of the automagical EDIT behavior.

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 3 of 3
(2,731 Views)