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

C H A P T E R 6

Dialogs

When to Use Sheets

Use sheets for dialogs specific to a document when the user interacts with the dialog and dismisses it before proceeding with work. Some examples of when to use sheets:

A modal dialog that is specific to a particular document, such as saving or printing.

A modal dialog that is specific to a single-window application that does not create documents. A single-window utility program might use a sheet to request acceptance of a licensing agreement from the user, for example.

Other window-specific dialogs typically dismissed by the user before proceeding. Use a sheet when a dialog benefits from being attached to the window as a modal dialog, even if you might otherwise design the dialog as a modeless dialog.

When Not to Use Sheets

Don’t use sheets for dialogs that apply to several windows. Sheets are strictly intended to be used in situations when a particular dialog is associated only with the window to which it is attached.

Sheets are not appropriate for modeless operations where the dialog should be left open to allow the user to observe the effects of changes applied. Such tasks (find and replace operations, for example) are better suited to modeless dialogs, utility windows (palettes), or drawers.

Don’t use a sheet on a window that doesn’t have a title bar. Sheets should emerge from a definite visual edge.

Alerts

Alerts display messages to inform users of situations that are notable or potentially dangerous.

98Types of Dialogs and When to Use Them

Apple Computer, Inc. June 2002

C H A P

T E R

6

 

 

Dialogs

 

 

 

 

Figure 6-2

A standard alert

 

 

 

 

Message text

No title

Informative text

Application icon

Cancel button

Default button

An alert should contain only the following elements:

Alert message text. This text, in emphasized (bold) system font, provides a short, simple summary of the error or condition that summoned the alert. Often the message is presented as a question.

Informative text. This text appears in the small system font and provides a fuller description of the situation, its consequences, and how to get out of it. For example, a warning that an action cannot be undone is an appropriate use of informative text.

Buttons for addressing the alert. Button names should correspond to the action the user performs when pressing the button—for example, Erase, Save, or Delete. For more information, see “Push Buttons” (page 120).

The application icon. Because of the Mac OS X window layering model (described in “Window Layering” (page 70)), an icon is necessary to make it clear to the user which application is displaying the alert.

In rare cases, you may want to display a caution icon in your alert, badged with the application icon as shown in Figure 6-3. A badged alert is appropriate only if the user is performing a task, such as installing software, and a possible side effect of that task would be the inadvertent destruction of data. Don’t use a

Types of Dialogs and When to Use Them

99

Apple Computer, Inc. June 2002

C H A P T E R 6

Dialogs

caution icon for tasks whose only purpose is to overwrite or remove data, such as Save or Empty Trash; too-frequent use of the caution icon dilutes its significance.

Important

Mac OS X dialogs should not use the different icons for “note,” “caution,” and “stop” alerts, as was done in

Mac OS 9. Most alerts should simply show the application icon.

Figure 6-3 A customized alert showing the caution icon badged with an application icon

To display an alert with the application icon, Carbon developers should use a standard alert, and Cocoa developers should use the alert and sheet functions in NSPanel.h. To produce the caution icon, Carbon developers should use the kAlertCautionAlert with the StandardAlert function; Cocoa developers should use the NSBeginCriticalAlertSheet function.

Also see “Layout Guidelines” (page 149), especially Figure 8-5 (page 155), and “Writing Good Alert Messages” (page 232).

100Types of Dialogs and When to Use Them

Apple Computer, Inc. June 2002

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