Bug 184284 - [Mac] Don't reorder buttons in MacOS if default is cancel
Summary: [Mac] Don't reorder buttons in MacOS if default is cancel
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: bugday
Depends on:
Blocks: 179451
  Show dependency tree
 
Reported: 2007-04-26 13:38 EDT by Brian Bauman CLA
Modified: 2021-09-13 05:14 EDT (History)
6 users (show)

See Also:


Attachments
fix (1.26 KB, text/plain)
2008-02-23 11:17 EST, Sebastian Davids CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Bauman CLA 2007-04-26 13:38:13 EDT
I need to set the cancel button as the default button in a dialog.  But in MacOS, they end up out of order [OK, Cancel] instead of the traditional Mac style of [Cancel, OK].

I think the problem lies in Dialog.initializeBounds().  It appears that there is code there that sets the default button as the right most button.  Unfortunately, if the default button is the cancel button, the Apple User Interface Guidelines are violated.

A suggested fix would be to set the default button as the right most button if the current criteria is met and its id != IDialogConstants.CANCEL_ID.

It would be super cool if when the only two buttons were OK and cancel with cancel being the default, if the OK button was moved as the right most button to comply with the User Interface Guidelines.  But I figured this would probably be a more complicated fix.
Comment 1 Eclipse Webmaster CLA 2007-07-29 09:22:28 EDT
Changing OS from Mac OS to Mac OS X as per bug 185991
Comment 2 Chris Aniszczyk CLA 2007-11-11 16:01:56 EST
How about a bugday for y'all
Comment 4 Sebastian Davids CLA 2008-02-23 11:17:07 EST
Created attachment 90549 [details]
fix

fixes the two-button case
Comment 5 Sebastian Davids CLA 2008-02-23 12:17:46 EST
The "more than two buttons" case is a little more complicated:

1 - buttons affecting the contents of the dialog should be left-aligned to the right of Help

2- buttons closing the dialog should be right-aligned
 
3 - buttons closing the dialog but resulting in a loss of data should be right-aligned but indented by 24 pixels from the others

see full discussion in the link posted above

@@

WizardDialog therefore should look like this:

[Help][< Back][Next >].....[Cancel][Finish]

Save Resource dialog (shown if you try to close a modified editor) should look like this:

[No]<24px>[Cancel][Yes]

@@

a quick-fix would be:

- right align the first two buttons
- left align the rest

a more elaborate version would use the IDs in IDialogConstants to resolve the alignment:

right-aligned:

OK_ID
CANCEL_ID
YES_ID
YES_TO_ALL_ID
RETRY_ID
PROCEED_ID
OPEN_ID
CLOSE_ID
FINISH_ID
SKIP_ID
STOP_ID

right-aligned after pixel indent:

NO_ID
ABORT_ID
IGNORE_ID 
NO_TO_ALL_ID

left-aligned:

DETAILS_ID
BACK_ID
NEXT_ID   
HELP_ID   
SELECT_ALL_ID
DESELECT_ALL_ID
SELECT_TYPES_ID

One problem with this scheme:

Some (e.g. Yes/No) are dependent on the question asked whether they are "destructive" so the above would depend on either a positive or negative question style: "Save changes?" vs. "Abort changes?"
Comment 6 Chris Aniszczyk CLA 2008-12-14 22:10:15 EST
Kim, wasn't this fixed recently or no?
Comment 7 Markus Keller CLA 2009-06-11 08:33:13 EDT
Bug 279297 is for the general problem with a default button that is not the default dismissal button (on Mac and GTK).

The "24 pixels" and the "left alignment" rules from comment 5 are Mac-specific, and I don't think that it's worth for us to spend time on this.
Comment 8 Susan McCourt CLA 2009-06-30 17:28:24 EDT
I'm keeping this bug open since it has a fix and specific examples for handling more complicated situations on the Mac.  Bug 279297 handles the more general issue in the dialog framework.
Comment 9 Boris Bokowski CLA 2009-11-26 12:03:45 EST
Prakash is now responsible for watching bug in the [Mac] component area.
Comment 10 Eclipse Webmaster CLA 2019-09-06 16:11:49 EDT
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.
Comment 11 Eclipse Genie CLA 2021-09-13 05:14:21 EDT
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.

--
The automated Eclipse Genie.