Community
Participate
Working Groups
Build 20020716 The Accessibility implementation for Buttons is ignored. No matter what I set the values to JAWS always reads the value set by setText or nothing if it is not sent. STEPS 1) Open the following example 2) Start JAWS 3) JAWs will only read the group box name and the text value for the button. import org.eclipse.swt.SWT; import org.eclipse.swt.accessibility.*; import org.eclipse.swt.accessibility.AccessibleControlListener; import org.eclipse.swt.accessibility.AccessibleListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.*; /* * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ /** * @version 1.0 * @author */ public class JAWSButtonTest { private static AccessibleListener listener = new AccessibleListener() { public void getName(AccessibleEvent e) { e.result = "Name"; } public void getHelp(AccessibleEvent e) { e.result = "Help"; } public void getKeyboardShortcut(AccessibleEvent e) { e.result = "Shortcut"; } public void getDescription(AccessibleEvent e) { e.result = "Description"; } }; private static AccessibleControlListener controlListener = new AccessibleControlListener() { public void getValue(AccessibleControlEvent e) { e.result = "Control Value"; } public void getChildAtPoint(AccessibleControlEvent e) { } public void getLocation(AccessibleControlEvent e) { } public void getChild(AccessibleControlEvent e) { } public void getChildCount(AccessibleControlEvent e) { } public void getDefaultAction(AccessibleControlEvent e) { } public void getFocus(AccessibleControlEvent e) { } public void getRole(AccessibleControlEvent e) { } public void getSelection(AccessibleControlEvent e) { } public void getState(AccessibleControlEvent e) { } public void getChildren(AccessibleControlEvent e) { } }; public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("JAWS test"); Group group = new Group(shell, SWT.SHADOW_NONE); group.setText("Group Title"); GridLayout layout = new GridLayout(); layout.numColumns = 2; group.setLayout(layout); Label label = new Label(group, SWT.NONE); label.setText("Label"); Button button = new Button(group, SWT.PUSH); button.getAccessible().addAccessibleControlListener (controlListener); button.getAccessible().addAccessibleListener(listener); group.setBounds(0, 0, 200, 100); shell.setSize(250, 200); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
The "Group" parent does not seem to be relevant. If a button is directly a child of a shell and it has an image rather than text, JAWS just says "Button" without giving a name etc. JAWS is calling the following IAccessible methods but is not using the results to describe the button: get_accChild get_accRole get_accParent get_accKeyboardShortcut get_accState accLocation get_accName get_accHelp get_accDescription get_accValue get_accChild get_accState I used the following test: import org.eclipse.swt.*; import org.eclipse.swt.accessibility.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; public class PR21771 { private static AccessibleListener listener = new AccessibleListener() { public void getName(AccessibleEvent e) { e.result = "Name"; } public void getHelp(AccessibleEvent e) { e.result = "Help"; } public void getKeyboardShortcut(AccessibleEvent e) { e.result = "Shortcut"; } public void getDescription(AccessibleEvent e) { e.result = "Description"; } }; private static AccessibleControlListener controlListener = new AccessibleControlListener() { public void getValue(AccessibleControlEvent e) { e.result = "Control Value"; } public void getChildAtPoint(AccessibleControlEvent e) { } public void getLocation(AccessibleControlEvent e) { } public void getChild(AccessibleControlEvent e) { } public void getChildCount(AccessibleControlEvent e) { } public void getDefaultAction(AccessibleControlEvent e) { } public void getFocus(AccessibleControlEvent e) { } public void getRole(AccessibleControlEvent e) { } public void getSelection(AccessibleControlEvent e) { } public void getState(AccessibleControlEvent e) { } public void getChildren(AccessibleControlEvent e) { } }; public static void main(String[] args) { Display display = new Display(); Image image = new Image(display, PR21771.class.getResourceAsStream("image.bmp")); Shell shell = new Shell(display); shell.setText("JAWS test"); shell.setLayout(new GridLayout(2, false)); Label label1 = new Label(shell, SWT.NONE); label1.setText("Label for button 1"); Button button1 = new Button(shell, SWT.PUSH); Accessible accessible1 = button1.getAccessible(); accessible1.addAccessibleControlListener(controlListener); accessible1.addAccessibleListener(listener); button1.setText("this is button 1"); button1.setToolTipText("tooltip for button 1"); Label label2 = new Label(shell, SWT.NONE); label2.setText("Label for button 2"); Button button2 = new Button(shell, SWT.PUSH); Accessible accessible2 = button2.getAccessible(); accessible2.addAccessibleControlListener(controlListener); accessible2.addAccessibleListener(listener); button2.setImage(image); button2.setToolTipText("tooltip for button 2"); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } image.dispose(); display.dispose(); } }
Verified using JAWS and win32 - the name and value are set but are ignored by JAWS.
What does inspect show for this case?
Here is the trace How found: Mouse move (136,82) hwnd=0x00110674 32bit class="Button" style=0x54014380 ex=0x0 Info: IAcc = 0x0014FDAC VarChild:[VT_I4=0x0] Interfaces: IEnumVARIANT IOleWindow Impl: Remote, need oleacc 4.2.5020.0 or greater Annotation ID: [not supported] Name: "Name" Value: "Control Value" Role: push button State: focusable Location: {l:122, t:75, w:26, h:23} Description: "Description" Kbshortcut: "Shortcut" DefAction: "Press" Parent: "Name":window Help: "Help" Help Topic: none [false] ChildCount: 0 Window: 0x00110674 class="Button" style=0x54014380 ex=0x0 Children: Container has no children Selection: none [empty] Ancestors: "Name" : window : focusable "JAWS test" : client : focusable "JAWS test" : window : sizeable,moveable,focusable "Desktop" : client : normal "Desktop" : window : normal [ No Parent ]
Need to verify whether this is an SWT or a JAWS problem. When SWT is asked for the name and none is set, does it answer the empty string or call the default window proc (I'm assuming this will call back through the Accessible API)?
I believe this is an SWT problem as JAWS is asking (and getting) the result in Veronikas tests. Veronika?
If the event.result is null or there is no AccessibleListener, then the default window result is returned. Otherwise, the value specified in event.result (even if it is an empty sstring) is reported. I think this is a JAWS problem.
If you think this is a JAWS problem, this would be an excellent bug to try Window-Eyes on. Window-Eyes has one of the most extensive default implementations of MSAA support. In JAWS, use of MSAA is less consistent.
Grant, could you try this test on WindowEyes?
WindowEyes has the same behaviour as described for JAWS. It always reads the Button's text, or none in the case of an image; it does not even ask our AccessibleListener or AccessibleControlListener for their answers.
Created attachment 7085 [details] AccessibleButtonTest, sent to Window-Eyes I am talking with Mike, a software developer at Window-Eyes. We identified one area where they have a bug: he says they are supposed to be able to read the accName for a graphic button with no text (i.e. if GetWindowTextLength is 0, then they call get_accName, otherwise they just call GetWindowText). I sent him a little test class (attached) that shows that they don't do this properly, and he said he was able to replicate the problem with my test case. If he fixes this, it will mean that Window-Eyes will read graphic buttons. As for reading the accName for a button that has text, that is a feature request. I have made the feature request, but he says they have a lot of higher-priority stuff they are working on, and he says that honestly, it would be a while before they got to it. All of the above applies to Labels (Static's) as well.
*** Bug 25740 has been marked as a duplicate of this bug. ***
If anyone has any examples of WHY one would want to override the visible text of a text button so that it says something else, please let me know, because an example would help me in my discussions with the Window-Eyes people.
How about for a Button with an Image instead of text?
The Color selection button used in Eclipse is our main use case
Excellent! Both of these use cases (button with image and no text, button with just a drawn color rectangle and no text) will be fixed if/when Mike fixes the bug in Window-Eyes that I pointed out to him. These use cases do not require them to implement the feature request of being able to override the visible text of a text button. Thanks for the concrete examples.
The bug in Window-Eyes has been fixed. This means that the next version of Window-Eyes will correctly read the accName of image buttons and "color" buttons - basically, any button without text. As for overriding the visible text of any non-custom control by providing an accName, that remains an outstanding feature request. But as it's not a common use case, the feature is not likely to go in any time soon. Now I just need to keep trying to access a developer at FreedomScientific to see if we can get JAWS to read these buttons too, but these people are not as responsive as the Window-Eyes people are.
Further info from the Window-Eyes developer about the likelihood of having the feature request implemented: "We have noted the feature suggestion and might implement it in the future (especially for ownerdrawn controls) if we see real examples of a need for the feature. Note that we have seen controls (even standard ones) blow up when we make MSAA queries with both the inspect and accevent methods so this feature would definately have to be optional."
This is fixed for buttons in the JAWS 5.0 upgrade (5.00.809). JAWS now reads the MSAA name of both graphic buttons and text buttons. You can go ahead and give all of your graphic buttons and color buttons nice names now! :) Unfortunately, JAWS does not read the MSAA name of Labels (graphic or text). Leaving this bug report open until JAWS reads the MSAA name for Labels, and Window-Eyes reads the MSAA name for text Buttons and graphic/text Labels. Might be a while. But note that the current behavior of both applications is a significant improvement, that works for the most common use case: graphic buttons.
Closing this bug because the important stuff is fixed and there's nothing more we can do - the rest is in the hands of the screen readers now.
*** Bug 60884 has been marked as a duplicate of this bug. ***
*** Bug 270039 has been marked as a duplicate of this bug. ***