Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Примеры брендбуков / apple_osx-aqua-human-interface.pdf
Скачиваний:
17
Добавлен:
16.02.2016
Размер:
8.01 Mб
Скачать

C H A P T E R 6

Dialogs

Dialog Behavior

When appropriate, your application’s dialogs should display default values for controls and text fields so the user can verify information rather than generating it from scratch. Display a selection or an insertion point in the first location—a text entry field or a list, for example—that accepts user input.

When it provides an obvious user benefit, static text in a dialog should be selectable. Some error message text, for example, could be selectable. Facilitating the copying of text (such as a serial number or a hostname) so it can be pasted accurately into another context is another example.

In dialogs that display columns and are user resizable, such as the Open dialog, as the dialog is made bigger, the columns grow and additional columns appear. All other elements remain the same size and anchor to the right, center, or left side of the dialog.

Accepting Changes

In general, all changes a user makes in a dialog should appear to take effect immediately. There are three possible opportunities for data validation in a dialog:

1.When the user types data

2.When the user moves out of a data field (by pressing Tab, for example)

3.When the user clicks a button to apply changes

It is your responsibility to make the three states as clear as possible to the user. For example, checkboxes and radio buttons update immediately and display the appropriate results.

Dialog Behavior

101

Apple Computer, Inc. June 2002

C H A P T E R 6

Dialogs

You need to decide when your application does error checking of user input. Possible approaches:

Evaluate the input and check for errors as the user tabs from one field to the next. The drawback is that it isn’t clear to the user that the changes are taking effect as he or she tabs among items. The user doesn’t click a button, and so isn’t aware of completing an action.

Save user input in a queue and apply it when the user clicks a button, closes the dialog, or switches to another application. If your application waits to check user-input errors until the user tries to dismiss the dialog, you may have to present an alert, thereby forcing the user to revisit the dialog. If you do error checking as the user enters input, it takes more time up front, but you can warn the user immediately when invalid data is entered.

In most cases, validating input after each keystroke is annoying and unnecessary. It’s better to design your interface to automatically disallow invalid input. For example, your application could automatically convert lowercase characters to uppercase when appropriate.

In addition to error checking, you need to decide when to apply user input. In some cases, changes can take effect immediately—for example, View Options for Finder windows. In other cases, it may be appropriate to wait until the user performs an action, such as clicking an Apply button.

In a dialog that has multiple panes (selected by tabs or a pop-up menu), avoid validating data when a user switches from one pane to another.

Finally, you need to determine whether your application should automatically perform an operation based on user input or whether the user should initiate the operation, for example, by clicking a button. It’s acceptable to automatically perform an operation that completes quickly and returns user control within a couple of seconds. For an operation that takes a longer time to execute, it’s best to warn the user of the estimated time required and let the user initiate it.

The Open Dialog

The Open dialog appears when the user chooses the Open command or presses Command-O. The Open dialog is application modal (the user can switch to other applications).

102Dialog Behavior

Apple Computer, Inc. June 2002

C H A P T E R 6

Dialogs

If you implement an Open command, you should also include an Open Recent command so users can access recently opened documents without going through the dialog.

Note: Navigation Services, introduced in Mac OS 8.5, has been enhanced to add support for Mac OS X. Its predecessor, the Standard File Package, is not supported in Mac OS X.

Figure 6-4

An Open dialog

 

 

 

Dialog Behavior

103

Apple Computer, Inc. June 2002

C H A P T E R 6

Dialogs

The Open dialog contains these elements:

A default title (“Open”); you should add your application’s name to the Open dialog title—”TextEdit: Open,” for example.

A From pop-up menu that contains Favorite Places (all containers in the user’s Favorites folder) and Recent Places (the five most recent folders the user opened or saved documents to). Your application specifies the default location, typically one of the predefined folders in the user’s home folder. (For recommended default locations, see “Files” (page 245).) If the user selects another folder, the dialog should “remember” the user’s selection the next time the dialog appears.

A column browser for navigating the file system.

A “Go to” text field, in which expert users can type file-system paths to navigate in the dialog. Pathnames must begin with “/” or “~”. (For guidelines about pathnames, see “Displaying Pathnames” (page 251).)

An Add to Favorites button, which adds an alias of the chosen folder to the user’s Favorites folder and immediately updates the Favorite Places list in the From pop-up menu. The Add to Favorites button is always active.

A Cancel button and an Open (default) button.

A resize control in the lower-right corner.

You can extend the Open dialog as appropriate for your application. For example, you could include a pop-up menu allowing users to filter the type of files that appear in the list (see Figure 6-5). Items that do not meet the filtering criteria would appear dimmed. The system creates a list of native file types supported by the application to populate the menu. You can supplement this list with custom types and specify the default to show when the dialog opens. You should include an All Applicable Files item, but it does not have to be the default.

104Dialog Behavior

Apple Computer, Inc. June 2002

Соседние файлы в папке Примеры брендбуков