It appears that MessageDialog has a usability flaw: It’s not possible to make the second button the default button, or am I missing something?
Note:
For “dangerous” confirmation dialog such as one would show when something might get accidentally deleted, the Cancel and not the OK button should be made the default button so that the user does not accidentally press the Return key and thereby performs an unintended destructive operation.
This is, BTW, often done wrong by switching the positions of the button. For example, this is even worse (example for Mac, not Windows - on Windows the buttons order is to be reversed):
THIS IS WRONG (on Macs):
Do you want to delete this data?
[Delete] [Cancel]
The above example is bad because a trained user has learned that any dialog he doesn’t expect has the Cancel button in the second-to-left position. So, if he wants to cancel something unexpected, he might BLINDLY click on that 2nd button - and if you make that the Delete button, you’ve screwed him. That behavior is called muscle memory and you should not try to be smarter by doing what’s shown above.
On the Mac, a dialog should ALWAYS have the right button be the one that continues the operation and the second button (on its left) be the one that cancels it. If you don’t follow this, you might upset your customers because you’d also have violated Apple’s UI guidelines. (Mind you, even Apple programs get this wrong sometimes, but get it usually fixed once I point that out via a bug report.)
THIS IS CORRECT (on Macs):
Do you want to delete this data?
[Cancel] [Delete]
Now, the only problem with this correct order is Xojo’s MessageDialog, because it won’t let me make the Cancel button the default button so that it appears highlighed (blue) and reacts to the Return and Enter keys. And that really sucks as this encourages Xojo programmers to reorder the buttons, thereby violating UI guidelines and causing trouble for users.