Details

You should consider the following issues when creating message boxes.

Present Only One Message Box

A variation of the unnecessary message box problem is to present a necessary error message with several variations of the same problem in separate message boxes. For example, suppose you are developing a program that accesses a CD-ROM, but the wrong CD-ROM is in the drive. The user should receive a single error message, not three or four, like Can't access CD-ROM, Can't open file, and Can't open document. One error message is enough.

Of course, this is easier said than done. The problem is that often such error handling is distributed across many low-level modules. The solution is to avoid displaying error messages in low-level modules but to pass back status information and let the calling module decide how to handle the error.

Present It Just Once

Whatever you do, don't keep asking the same question over and over again. Have you ever been low on disk space? If so, Windows 95 presents you with this dialog box:

If you click the Cancel button, guess what happens? A few minutes later you will receive the same message again. Even though you have explicitly told Windows not to bother you with this problem, it continues to remind you until you finally submit and empty the Recycle Bin. This message would be improved either by waiting several hours between messages or by giving the user an option not to display the message in the future.

Another good example of an annoying message box comes from the Windows 95 ScanDisk utility. When I run ScanDisk on my computer, I get the following error message:

Unfortunately, the one option I really want is

I don't care about this error because I will never attempt to access anything in this folder in MS-DOS mode. This error practically renders ScanDisk useless to me because I have hundreds of such folders on my computer and would prefer not to press the OK button a few hundred times to check my hard disk. Fortunately, Windows 98 has solved this problem by providing a Report MS-DOS Mode Name Length Errors option that I can turn off in the Advanced Options dialog box.

One last example: copying a group of files using Windows Explorer. If one of the files you are copying already exists in the target folder, you receive the following message:

The Yes To All option is especially nice, since it allows you to complete the operation without having to respond to possibly many message boxes. However, note that answering No is also a sensible thing to do, so this message box could be greatly improved by adding a No To All option. If you are copying a thousand files, you shouldn't have to click No a few hundred times.

Consider Message Box Time-Outs

While message boxes are sometimes a pain to use, they are even more painful when you don't use them. Have you ever prepared a large project build or a large print job to run overnight and then come back the next morning only to find a confirmation like this one?

Without a response, the program is essentially locked up forever.

Since Visual C++ does occasionally crash and burn during a compile, I truly appreciate having Visual C++ save my files before it compiles, so this is clearly a necessary dialog box. However, I would prefer that Visual C++ not save a file rather than wait forever for me to respond.

The solution? Use a time-out, as is done in the following example from Outlook. If you have a message box whose response is optional (typically if the issue is trival or if there is an appropriate default response) and the lack of response will prevent your program from doing important work, the message box should time-out after a few minutes. Without a time-out, even a necessary message box can be pure evil.

When in Doubt, Make It Configurable

When in doubt about a message box, make it configurable. I don't mind using a program that confirms an exit as long as I have the ability to turn this confirmation off. Provide the user the ability to not display certain types of messages, either from program options or from the message box itself, as with the following example:

If you provide an option like this, you should also provide a mechanism to undo this action, preferably through an options property sheet.



Developing User Interfaces for Microsoft Windows
Developing User Interfaces for Microsoft Windows
ISBN: 0735605866
EAN: 2147483647
Year: 2005
Pages: 334

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