Menu is disabled on Windows (plugins.window.MenuBar)

Questions and answers on developing, deploying and using plugins and JavaBeans

Menu is disabled on Windows (plugins.window.MenuBar)

Postby huber » Tue Mar 31, 2015 4:36 pm

I have following code in the onOpen method of our solution. On OS X, it works as expected. On Windows (Win 7 for example), the third menu, in my code Fenster, i. e. Window, is disabled (greyed out). This means the menu items are not visible and therefor can't be selected. I just can't figure out why this happens on Windows as there is no disabling or access rights involved in this code.

Code: Select all
var menuBar = plugins.window.getMenuBar();
   menuBar.removeMenu([2, 3, 4]); // Remove from menu bar items View (Ansicht), Select (Datensätze), Methods (Methoden)   
   menuBar.getMenu(0).removeItem([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); // Remove File menu items Open Solution, Close, hyphen, Page setup..., hyphen, Print Preview, Import, Export, hyphen, Logout (Abmelden)
   menuBar.getMenu(2).removeAllItems(); // Remove all Window menu items
   menuBar.getMenu(2).addMenuItem(i18n.getI18NMessage(''), forms.Main.setDefaultSize); // Add menu item set default (application window) size at index 0
   menuBar.getMenu(3).removeAllItems(); // Remove all Help menu items
   menuBar.getMenu(3).addMenuItem(i18n.getI18NMessage(''), forms.Main.onActionHelp); // Add menu item Help... at index 0
   menuBar.getMenu(3).addMenuItem(i18n.getI18NMessage(''), forms.Main.onActionConcepts); // Add menu item for concepts at index 1
   menuBar.getMenu(3).addMenuItem(i18n.getI18NMessage(''), globals.showSplashScreen); // Add menu item About Hades... at index 3

Robert Huber
7r AG, Switzerland
SAN Developer
User avatar
Posts: 518
Joined: Mon May 14, 2012 11:31 pm

Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 3 guests