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

C H A P T E R 6

Dialogs

Closing a Document With Unsaved Changes

When the user attempts to close a document that has unsaved changes, present a Save Changes alert. An application that saves the contents of individual windows— like most text and graphics applications—should use document-specific sheets, like the one shown in Figure 6-8, for its Save Changes alert. In an application that can display multiple views of the same file, if the user chooses the Close File command (instead of Close Window; see “The File Menu” (page 56)), open the sheet on the frontmost window and change the alert message text from “document” to “file”; after the user clicks Save or Don’t Save, close all open views of the file.

Figure 6-8 A Save Changes alert for a document-based application

When a Save Changes sheet is open, the document’s close button and the Close command in the File menu are unavailable; the user can’t close the document until the Save Changes sheet is addressed.

As described in “Sheet Behavior” (page 97), if an application provides multiple views of the same document, the sheet should open on the active window and prevent the user from interacting with other open views of the file.

Dialog Behavior

109

Apple Computer, Inc. June 2002

C H A P T E R 6

Dialogs

Saving Documents During a Quit Operation

In Mac OS X, users can interrupt a quit operation with documents still unsaved. For example, if a user chooses Quit and a save alert (a sheet) opens for a document, the user can work on other documents or switch to another application without addressing the save alert. To minimize the impact of such interruptions, all save alerts initiated by a Quit command should include a message that alerts users that they are in the midst of a quit operation. See Figure 6-10 (page 111) for an example.

When a user quits an application in which all open documents have been saved, all documents close immediately and the application quits.

Quitting an Application That is Not Document-Based

When a user attempts to quit an application that is not document-based (the contents of many windows are saved simultaneously), present an application-modal Save Changes alert, such as the one shown in Figure 6-9.

Figure 6-9 A Save Changes alert for an application that is not document-based

110Dialog Behavior

Apple Computer, Inc. June 2002

C H A P T E R 6

Dialogs

Quitting an Application With One Unsaved Document Open

When a user attempts to quit a document-based application and there is only one document with unsaved changes open, present a Save Before Quitting alert (such as the one shown in Figure 6-10) as a sheet attached to the unsaved document, perform the actions described in “The Minimal Save Dialog” (page 106), and then quit the application as appropriate.

Note that the Don’t Save button, which can result in data loss, is positioned away from the “safe” buttons (Cancel and Save). The keyboard combination Command-D should be implemented for the Don’t Save button.

Figure 6-10 The Save Before Quitting alert (sheet) that appears when the user quits with only one unsaved document

Dialog Behavior

111

Apple Computer, Inc. June 2002

C H A P T E R 6

Dialogs

Quitting an Application With Multiple Unsaved Documents Open

When a user attempts to quit a document-based application and there is more than one document with unsaved changes open, present an application-modal Review Changes alert, such as the one shown in Figure 6-11.

Figure 6-11 The Review Changes alert (application modal) that appears when the user quits with more than one unsaved document open

The appropriate action for each button is as follows:

Discard Changes. Closes all documents without saving changes and quits the application.

Cancel. Cancels the Quit command.

Review Changes. All open documents (including those minimized in the Dock) come forward, with the unsaved documents on top. The active document presents the Save Before Quitting alert (see Figure 6-10 (page 111)). If the user clicks Save, the Save dialog appears (if the document has not previously been saved). If the user clicks Don’t Save, the next unsaved document comes forward with its Save Before Quitting alert. If the user dismisses the last Save Before Quitting alert with Save or Don’t Save, all documents close and the application quits.

112Dialog Behavior

Apple Computer, Inc. June 2002

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