Rules for the Default Button and Initial Focus

You need to assign the default button and the control that has initial focus carefully. Generally, you want to assign these controls to eliminate unnecessary effort for the user. For example, in the case study in Chapter 24, "Unnecessary Repetitive Tasks Are Evil" I show how strategically assigning the initial input focus eliminates unnecessary effort. On the other hand, some of your program's functions might be destructive, so you don't want them to be too easy to do—you want to prevent the user from making catastrophic errors by accident. There is a fine line between protecting the user and pestering the user, so I'll try to help you make that distinction.

In Chapter 4, "Establish a Consistent User Interface Style" I gave the rule that irreversible or destructive actions should never be the default. This works well as a basic rule, but let's look specifically at how you should assign default buttons. For a normal, nondestructive dialog box, the rule is simple: assign the default button to the command the user is most likely to choose, usually the OK button or its equivalent. This rule makes the dialog box more convenient to use.

TIP
For dialog boxes with nondestructive actions, assign the default button to the command the user is most likely to choose.

In the case where the action performed by the dialog box is destructive (such as deleting a file), I like to use what I call the one-mistake rule. That is, the user should be able to make any single mistake without serious consequences.

TIP
For dialog boxes with destructive actions, assign the default button so that the user can make any single mistake without serious consequences.

In the case where the action performed by the dialog box is catastrophic (such as formatting a disk), I like to use the two-mistake rule. That is, the user should have to make two explicit mistakes in a row before there are serious consequences. I consider clicking the wrong button to be an explicit mistake, whereas pressing Enter is an implicit mistake.

TIP
For dialog boxes with catastrophic actions, assign the default button so that the user has to make two explicit mistakes in a row before there are serious consequences.

Let's look at a couple examples. If I use Windows Explorer to delete a file, I get the following confirmation:

Having the Yes button as the default is correct in this case, even though it is a destructive action. Why? Suppose that I deleted the file by accident. Pressing the Delete key would be my first mistake and then pressing Enter accidentally to confirm would be my second mistake, so I would have had to make two mistakes in a row to accidentally delete a file. Any single mistake can be corrected. Since deleting a file isn't catastrophic (especially since I can undo the action by using the Recycle Bin), this is the correct assignment of the default button.

Now if I use Windows Explorer to format a floppy disk, I get the following dialog box:

In Windows 98, the Close button is the default, which is correct since accidentally formatting a floppy can be catastrophic (although you can undo a floppy format by using special software). In this case, I need to make two explicit mistakes in a row to accidentally format a floppy: I need to accidentally select the Format command and then accidentally press or click the Start button. I cannot format a floppy by mistakenly pressing the Enter key after my first mistake. If this were a command to format a hard disk, I wouldn't mind an additional confirmation after selecting the Start button. This way, formatting a hard disk by accident would require three mistakes in a row. After all, I don't format hard disks every day, so an additional confirmation here isn't exactly a burden. Happily, most dialog box actions are not destructive, so you can apply the first rule of assigning the default button to the command that the user is most likely to choose most of the time.

The initial input focus can be set to any noncommand button control independently of the default button. The input focus rule is simple: assign the initial input focus to the control the user is most likely to interact with first. Note that since the default button moves to the command button with input focus, you never have to worry about destructive actions when assigning the initial input focus if you follow the previous rules.

TIP
Assign the initial input focus to the control that the user is most likely to interact with first.



Developing User Interfaces for Microsoft Windows
Developing User Interfaces for Microsoft Windows
ISBN: 0735605866
EAN: 2147483647
Year: 2005
Pages: 334
Authors: Everett N McKay
BUY ON AMAZON

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net