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

C H A P T E R 6

Dialogs

Document modal: Prevents the user from doing anything else within a particular document. The user can switch to other documents in the application, and to other applications. Document-modal dialogs should be sheets, which are discussed in “Document-Modal Dialogs (Sheets)” (page 96).

Application modal: Prevents the user from doing anything else within the owner application; the user can still switch applications. Most application-modal dialogs do not have the standard title bar controls (close, minimize, zoom); the user dismisses these dialogs by clicking a push button, such as OK or Cancel. Application-modal dialogs that appear as the result of the user choosing a command, such as the Open dialog in Figure 6-4 (page 103), should display a title that matches the command.

An alert can be nonmodal, document modal, or application modal. If the error condition or notification applies to a single document, the alert should be document modal (a sheet). See the Save Changes alert in Figure 6-8 (page 109) for an example. If the alert applies to the state of the application as a whole, or to more than one document or window belonging to that application, the alert should be application modal. Both the Review Changes alert for multiple unsaved documents (Figure 6-11 (page 112)) and the Save Changes alert for applications that are not document-based (Figure 6-9 (page 110)) are application modal.

Document-Modal Dialogs (Sheets)

A sheet is a modal dialog attached to a particular document or window, ensuring that the user never loses track of which window the dialog applies to. The ability to keep a dialog attached to its pertinent window helps users take full advantage of the Mac OS X window layering model (see “Window Layering” (page 70)). Sheets also allow users to perform other tasks before dismissing the dialog, so there’s no longer the sense of the system being “hijacked” by the application.

You lay out sheets like any other dialog in Mac OS X. Carbon developers are responsible for creating, showing, handling the events for, and closing sheets. Other sheet behavior, such as the animation when it appears, is handled automatically by the Window Manager. Cocoa developers are responsible for loading, showing, and closing sheets. While a sheet it displayed, events are handled by the Application Kit just as for any other window. Other sheet behavior, such as the animation when it appears and is dismissed, is handled automatically by the Application Kit.

96Types of Dialogs and When to Use Them

Apple Computer, Inc. June 2002

C H A P T E R 6

Dialogs

Figure 6-1 The Save Changes alert: An example of using a sheet to display a document-modal dialog

Sheet Behavior

Sheets are displayed as an animation that appears to emerge from the window’s title bar. When a sheet opens on a window near the edge of the screen, and the sheet is wider than the window it’s attached to, the sheet moves the window away from the edge; when the sheet is dismissed, the window returns to its previous position.

Only one sheet may be open for a window at any one time. A sheet prevents any other operation on that window until the sheet is dismissed. If, when the user responds to a sheet, another sheet for that document must open, the first sheet closes before the second one opens.

A sheet on an active document window should cover (appear on top of) any active utility windows (if necessary). However, if the user leaves a sheet open and clicks another document in the same application, the inactive window and its sheet should go behind any open utility windows.

In an application that provides multiple windows for the same document (so that the user can see different parts of a document simultaneously), a sheet would open on the active window, and the user must dismiss the sheet before interacting with other open views of the file.

Types of Dialogs and When to Use Them

97

Apple Computer, Inc. June 2002

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