Add dialog that checks for duplicate accelerators
Description:
Something Windows resource editors have always had is the ability to check for duplicate accelerator keys. So for example, if you had the following:
m_MenuBar->Append(menu, _tt("&File"));
m_MenuBar->Append(menu, _tt("&Favorites"));
A Windows resource editor would have a function that would detect that &F was used more than once.
wxUiEditor should have something that tests the current top level form for duplicates. A dialog could be displayed that lists all of the duplicates and allows the user to change them in the dialog (making sure the changes don't simply conflict with another accelerator). This would work on menus and dialogs.
Perhaps a better way to handle this would be to hook it into our property grid validator code. If it's a prop_label and the form is a wxDialog or wxPanel, then parse all the controls with a prop_label, and create a map of accelerator/label pairs in use. We can then check to see if the accelerator is in use, and warn the user either directly or via a wxInfoBar (which we already use). If it's an infobar, we could show the names of both labels. Note that it is valid to use duplicate accelerators in a Dialog -- pressing the accelerator again steps between all the controls with the same accelerator.
For Menu Items, we need a warning that is more obvious, since the same accelerator in an item under the same Menu will never be used because the first accelerator will activate the menu item event.
Given that this issue is coming up on 5 years old, I don't think I'll ever get around to implementing a special dialog that would highlight each duplicate accelerator control the way the VS Resource editor did it. However, parsing all the label properties in a form, and the menu items in a menu would be relatively easy to do.