Bug 20563 - [Dialogs] UI does not honour "Move pointer to default button" behaviour of new mouse drivers
Summary: [Dialogs] UI does not honour "Move pointer to default button" behaviour of ne...
Status: RESOLVED DUPLICATE of bug 67031
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P5 minor (vote)
Target Milestone: ---   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords: accessibility
: 17927 28351 (view as bug list)
Depends on: 15559
Blocks: 22561
  Show dependency tree
 
Reported: 2002-06-18 14:34 EDT by Dean Roberts CLA
Modified: 2005-01-06 11:41 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Roberts CLA 2002-06-18 14:34:22 EDT
Most newer Windows mouse drivers support an option to:

  "Automatically moves the pointer to the default button in a dialog box"

This seems to work in most applications, however, we do not honour it in 
Eclipse.

I tried it with the "Bad number" error prompter in the filter dialog (I was 
told this was a real honest to goodness OS dialog) and it did not work.
Comment 1 Mike Wilson CLA 2002-06-19 09:24:36 EDT
It's not even clear to me how we could *stop* this from working. To be fixed 
post R2.0.
Comment 2 Steve Northover CLA 2002-06-19 10:21:28 EDT
*** Bug 17927 has been marked as a duplicate of this bug. ***
Comment 3 Steve Northover CLA 2002-07-04 12:10:04 EDT
This is now honoured in dialogs for default buttons (control with the Windows 
window class "BUTTON") that are direct children of a dialog shell.  Windows 
mouse drivers detect this case and acts accordingly.  

On Windows, dialogs are typically created from resource files where the widget 
tree is exactly one level deep.  Eclipse on the other hand, tends to build 
hiearchies of widgets.  Unfortunately, I could not find a way to convince the 
Windows mouse driver to look into a hierarchy of widget for the default button.

Here is some code that shows this feature working:

public static void main200 (String [] args) {
	Display display = new Display ();
	Shell shell = new Shell (display);
	shell.pack ();
	shell.open ();
	Shell dialog = new Shell (shell, SWT.DIALOG_TRIM);
	Label label = new Label (dialog, SWT.NONE);
	label.setText ("Exit the application?");
	Button okButton = new Button (dialog, SWT.PUSH);
	okButton.setText ("&OK");
	Button cancelButton = new Button (dialog, SWT.PUSH);
	cancelButton.setText ("&Cancel");
	
	FormLayout form = new FormLayout ();
	form.marginWidth = form.marginHeight = 8;
	dialog.setLayout (form);
	FormData okData = new FormData ();
	okData.top = new FormAttachment (label, 8);
	okButton.setLayoutData (okData);
	FormData cancelData = new FormData ();
	cancelData.left = new FormAttachment (okButton, 8);
	cancelData.top = new FormAttachment (okButton, 0, SWT.TOP);
	cancelButton.setLayoutData (cancelData);
	
	dialog.setDefaultButton (okButton);
	dialog.pack ();
	dialog.open ();
	
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}
Comment 4 Steve Northover CLA 2002-07-04 12:13:45 EDT
I'm sorry but Eclipse dialogs need to be changed so the default button is a 
direct child of the shell.  It turns out that screen readers such as JAWS 
expect this structure anyways so this change may be necessary anyways.

I'm adding 15559 to the dependency list even though they are not stictly 
related.  In order to fix both problems, Eclipse dialogs need to be rewritten.
Comment 5 Steve Northover CLA 2002-07-04 12:14:30 EDT
Moving to UI.
Comment 6 Steve Northover CLA 2002-07-04 12:15:58 EDT
BUGZILLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLAAAHHHHHHHHHHHHHH!!!!!!!!!!!
Comment 7 Tod Creasey CLA 2002-08-08 13:13:41 EDT
This would be a post 2.1 change as it would break all current dialogs.
Comment 8 Gunnar Wagenknecht CLA 2002-08-08 13:50:47 EDT
Can you explain it a little bit more detailed please?

I can't understand why this would break all dialogs? From my understanding the 
mouse pointer simple needs to jump to the default button if a new dialog box 
pops up and has focus. 

I havn't developed with dialog boxes yet but from the things I seen so far, 
there is already the posibility of defining a default button in dialogs. Thus, 
there is no API change.

The only change should be in the native Win32 SWT code calling Windows API 
because this "jump" is a windows setting and should never be turned of by 
applications. A possible fix shouldn't change any public or protected Java API 
used by other (external) applications developed using SWT (like Eclipse).

This bug reduces usability in a way that is not suitable for 32bit Windows 
applications using "native Win32 API".

I'd like to have the severity at least set to "normal".
Comment 9 Gunnar Wagenknecht CLA 2002-08-20 07:44:16 EDT
Has anyone done some changes in 2.0.1 branch? 
Comment 10 Steve Northover CLA 2002-08-20 09:20:56 EDT
Gunnar, please re-read my comments from 2002-07-04 12:10 describing how "move 
to default button" is implemented by Windows.  We are currently restricted to 
the support provided by Windows.

The summary is, "no API change is necessary in SWT but Eclipse dialogs need to 
be recoded so that push buttons are the direct children of a dialog shell".
Comment 11 Tod Creasey CLA 2002-08-26 15:43:45 EDT
The breaking change is the removal of the buttonBar Composite in dialogs. 
Currently code is written assuming the existance of the button bar when adding 
in your buttons.

We could rework this but it would require API changes that will break existing 
dialogs. This is also an accessibility issue BTW.
Comment 12 Steve Northover CLA 2002-12-17 12:11:35 EST
*** Bug 28351 has been marked as a duplicate of this bug. ***
Comment 13 Gunnar Wagenknecht CLA 2003-06-02 14:11:36 EDT
Any news? I suggest a reassessment of the severity and the priority. This is a 
MUST-FIX for 3.0 because it is really bad UI.

Is it possible to implement this above the native layer? I saw OpenOffice has 
a switch for that (do nothing/jump to dialog center/jump to default button) 
that works on multiple platforms.

The SWT shell might get such a switch and the "jump to" functionallity is 
emulated via positioning the mouse pointer on all platforms. I don't know.
Comment 14 Tod Creasey CLA 2005-01-06 11:41:40 EST

*** This bug has been marked as a duplicate of 67031 ***