.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

508 Compliance on AutoCAD "Big A" Application Menu

1 REPLY 1
Reply
Message 1 of 2
dick_w
752 Views, 1 Reply

508 Compliance on AutoCAD "Big A" Application Menu

In a custom AutoCAD plugin, we add a new menu item to the "Big A" Application Menu and then add RibbonMenuItems to it, as follows:

 

                ApplicationMenuItem mi = new ApplicationMenuItem();

 

                RibbonMenuItem rmCreateMenuItem = new RibbonMenuItem();
                rmCreateMenuItem.Text = strSubMenu_Create_Label;
                rmCreateMenuItem.Description = strSubMenu_Create_Desc;
                rmCreateMenuItem.LargeImage = GetIcon(strSubMenu_Create_Icon);
                rmCreateMenuItem.CommandHandler = new AutoCADCommandHandler(AAAMenuConstants.createCmd);
                mi.Items.Add(rmCreateMenuItem);

 

The menu is created and works.

We have a requirement to support 508 compliance.  We are able to cycle through the RibbonMenuItems with the up and down arrow buttons.

But when we hit the Enter <CR> key, nothing happens.  A click to the menu item works OK.

 

It seems that control should be getting sent to AutoCADCommandHandler (which is a kind of System.Windows.Input.ICommand) when the enter key is pressed, but it is never called in this case.  It is only called and processed on mouse clicks.

The standard AutoCAD menu items does accept enter keystrokes.

What else must we do to be able to handle the enter keystrokes?

 

 

Tags (1)
1 REPLY 1
Message 2 of 2
philippe.leefsma
in reply to: dick_w

Hi ****,

 

So far I do not reproduce the behavior on my side, the sub-menu items handler get invoked while clicking enter.

 

Here is the code I am using, if you still having issues with that topic, please consider providing a more complete sample that I can test on my side.

 

private void AddMenuInBigA(string MenuText, string msg)
{
    ApplicationMenu menu = Autodesk.Windows.ComponentManager.ApplicationMenu;
    ApplicationMenuItem mi = new Autodesk.Windows.ApplicationMenuItem();

    mi.Text = MenuText;
    mi.CommandHandler = new BigACommandHandler(msg);

    //Add menu subitems
    ApplicationMenuItem sub1 = new ApplicationMenuItem();
    sub1.CommandHandler = new BigACommandHandler("Sub-Item1");
    sub1.Text = "Sub-Item1";
    mi.Items.Add(sub1);

    RibbonSeparator sep1 = new RibbonSeparator();
    mi.Items.Add(sep1);

    ApplicationMenuItem sub2 = new ApplicationMenuItem();
    sub2.CommandHandler = new BigACommandHandler("Sub-Item2");
    sub2.Text = "Sub-Item2";
    mi.Items.Add(sub2);

    menu.MenuContent.Items.Add(mi);
}

public class BigACommandHandler : System.Windows.Input.ICommand
{
    private string mMenuMsg;

    public BigACommandHandler(string msg)
    {
        mMenuMsg = msg;
    }

    public bool CanExecute(object parameter)
    {
        return true;
    }

    public event EventHandler CanExecuteChanged;

    public void Execute(object parameter)
    {
        System.Windows.MessageBox.Show(mMenuMsg);
    }
}

 


Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost