Book a Demo

Author Topic: How do I add an accelerator key for an addin menu?  (Read 3541 times)

Marko Kaiser

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
How do I add an accelerator key for an addin menu?
« on: March 11, 2013, 07:53:23 pm »
A user requested me to add an accelerator key for a menu item in the addin menu. Is there a way to do this in c#? I could not find something about that in EA.chm.

manfredw

  • EA User
  • **
  • Posts: 47
  • Karma: +0/-0
  • gaudeo ligneo!
    • View Profile
Re: How do I add an accelerator key for an addin m
« Reply #1 on: March 11, 2013, 09:29:23 pm »
Hello Marko,

not sure iff that is what you want to do, but here is how you create the shortcuts within the menu:

Code: [Select]
   public class YourAddinClass
    {
        // define menu constants
        const string menuHeader = "-&YourAddin...";
        const string menuSomeFunction = "&Some Function";
        ...

        public object EA_GetMenuItems(EA.Repository Repository, string Location, string MenuName)
        {

                switch (MenuName)
                {
                    case "": // header goes here
                        return menuHeader;
                    case menuHeader: // submenus go here
                        string[] subMenus = { menuSomeFunction };
                        return subMenus;
                }
 
            return "";
        }
    }

HTH

Manfred

Marko Kaiser

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: How do I add an accelerator key for an addin m
« Reply #2 on: March 11, 2013, 10:29:09 pm »
No I already have a menu with multiple entries. I want to add an accelerator key for one menu item.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How do I add an accelerator key for an addin m
« Reply #3 on: March 12, 2013, 12:46:16 am »
You can't.

Geert