| Summary: | Mnemonic on top level menu item does not fire selection event | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Sebastian Habenicht <dev> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | tbuschto |
| Version: | 2.1 | Flags: | tbuschto:
review+
|
| Target Milestone: | 2.2 M1 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | sr211 | ||
Fixed with commit 6ae461fdceccbf751a1c0a9e8d1c061da632af3e. (In reply to comment #1) > Fixed with commit 6ae461fdceccbf751a1c0a9e8d1c061da632af3e. Hi Ivan, is there any chance to have this fix in the service release 2.1.1 or 2.1.2? Since keyboard control in applications is a very important functionality it would be great to provide full mnemonics menu control with 2.1 instead of waiting a year for 2.2. Thank you, Sebastian I've marked it for 2.1.1 consideration. While the changes aren't trivial, I'll approve since it seems to reduce complexity instead of adding. +1 for SR211 Backported to 2.1-maintenance branch with commit 1df900d261b84f9397ad600bc82c98fc1b791c91. |
since fix of this bug [1] firing selection events on top level menu items is supported. However, the selection event is still not fired when using mnemonics on the top level menu item. In SWT, the following snippet fires the selection event for both menu items ("&Submenu" and "&Top Level Menu Item") when using the mnemonics. In RWT only "&Submenu" is selected: @Override protected void createContents(final Composite parent) { // define mnemonic activator and create menu bar getShell().getDisplay().setData(RWT.MNEMONIC_ACTIVATOR, "CTRL+ALT"); final Menu menuBar = new Menu(getShell(), SWT.BAR); // create cascading menu item final MenuItem cascadeMenuItem = createMenuItem(menuBar, SWT.CASCADE, "&Cascade Menu Item"); // create sub menu item of cascading menu item final Menu submenu = new Menu(getShell(), SWT.DROP_DOWN); cascadeMenuItem.setMenu(submenu); createMenuItem(submenu, SWT.PUSH, "&Submenu"); // create top level menu item createMenuItem(menuBar, SWT.PUSH, "&Top Level Menu Item"); // set menu bar to shell getShell().setMenuBar(menuBar); } private static MenuItem createMenuItem(final Menu parent, final int style, final String text) { final MenuItem menuItem = new MenuItem(parent, style); menuItem.setText(text); menuItem.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { System.out.println("Selected item: " + text); } }); return menuItem; } Regards, Sebastian PS: Id in forum: 490285