Summary: | Mnemonic traversal | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Dave Smith <dave.smith> | ||||
Component: | SWT | Assignee: | Silenio Quarti <Silenio_Quarti> | ||||
Status: | NEW --- | QA Contact: | |||||
Severity: | enhancement | ||||||
Priority: | P3 | CC: | eclipse.felipe, remy.suen, steve_northover | ||||
Version: | 3.5 | ||||||
Target Milestone: | --- | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Dave Smith
2009-03-03 10:42:34 EST
IMO, this is not a normal usage for mnemonic. Point me to an UI in windows that is doing this. I don't think we should change the current implementation for mnemonic. Maybe the application can hook SWT.Traverse and enforce this behaviour themselves. Steve to comment. Created attachment 127336 [details]
Example Visa Screen snap
Attached screen cap from Vista, Firefox 3.0.6, Options screen, Alt-H toggles between Search Engines and Help.
Here is some example code: import org.eclipse.swt.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; public class PR_266868 { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); Button b1 = new Button (shell, SWT.PUSH); b1.setText("b1 - &A"); Button b2 = new Button (shell, SWT.PUSH); b2.setText("b2 - &A"); shell.pack(); shell.open(); display.addFilter(SWT.Selection, new Listener () { public void handleEvent (Event e) { System.out.println(e); } }); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } } The behavior would be a bit strange. The first traversal would send the selection event for b1, then the next traversal would run it for b2 (but only if there had already been a selection in b2 that was caused by traversal). If the selection event had come from the mouse or the keyboard (ie. space bar), then the selection should run? Should it run when the last mnemonic control was selected somehow? Under Windows/GTK the logic is if there is more than one match it only assigns focus to the control does not activate it. So in your example the next button matching in the tabbing sequence would get focus. I would add another button to your example that has &B. So alt A would toggle focus between the buttons and Alt B would fire a selection on the button. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. |