Common Desktop Environment: Style Guide and Certification Checklist

File Selection Dialog Boxes

The Common Desktop Environment file selection dialog box is a subclass of the Motif file selection dialog box that has enhancements for improved usability. As long as your application uses the standard Motif file selection dialog box calls, the Common Desktop Environment enhanced version will appear in the Common Desktop Environment environment. There are additional guidelines to follow to make your dialog consistent and easy to use. Use the file selection dialog box whenever your application supports a task that involves choosing a file or directory. Examples are: Open, Include, Save As, and Copy To.

Contents

required 

7-10: 

If your application uses a file selection dialog box, it contains the following components: 

  • A directory Text component showing the current directory path. The user can edit the directory Text component and press <Return> or <Enter> to change the current directory.

  • A group of push buttons, including a command button, and Update, Cancel, and Help buttons. The command button is typically labeled Open or Save, but if there is another label that better describes the resulting action (such as Include), that label should be used. Activating the command button carries out the corresponding action and dismisses the file selection dialog box.

  • For applications that allow saving to different formats, an option button allowing users to specify the format when saving a file.

  • A file name Text component for displaying and editing a file name. This component is optional when the file selection dialog box is used to choose an existing file or directory.

Figure 7-4 Example of an Open file selection dialog box

Graphic

Required 

7-17: 

The file selection box displays the contents of a directory in the contents list when the file selection box is initialized, when the user presses Enter or Return in the directory text component, and when the user opens a directory in the contents list. The contents list is updated each time the contents of the directory changes. 

This specification ensures the consistent operation of a directory and file search in a file selection dialog box. 

Optional 

ht: 

Directory and file name lists should be presented alphabetically, case insensitive. The first item on the directory list should be the parent directory and it should be labeled "..". 

Recommended 

de: 

The file selection dialog box should not display hidden (dot) directories or files, unless your users depend on using these types of files. If your application does support displaying hidden files, you should supply a check box allowing users to toggle between showing and not showing hidden files, or else allow users to toggle between showing and hiding files at a global level in your application. 

Recommended 

df: 

The file selection dialog box should not show the full path names for files and directories, but should only show the relative names, except for the directory text field 

The global Common Desktop Environment setting should be: 

XmFileSelectionBox.fullPathMode: false

Unless your application overrides this behavior, your file selection dialog box should not show full path names in the list boxes. 

Required 

dg: 

In general, the file selection dialog box should recall the directory location that was previously set by the user. 

For example, if the user brings up Save As and navigates to /users/jay/letters to save the file, the next time the user brings up Save As, the file selection box should be in the directory /users/jay/letters. This information, however, should not be recalled once the user has closed the primary window, but should resort to the default directory.

If your application supports multiple primary windows, each window should recall the directory location that was set for that window. 

File Selection Dialog Box Behavior

Optional 

hq: 

The file selection dialog box should come up in a directory that makes sense for the task. For example, when saving a new file from an editor, the file selection box should come up in the user's home directory. If the user navigates to some other directory within the file selection box, the application should remember that directory the next time it is brought up. 

Optional 

hr: 

Users should never be allowed to overwrite an existing file through the file selection box without a warning dialog box prompt. 

Optional 

hs: 

Keyboard focus should be placed in the file name field each time users bring up a file selection dialog box. 

Labeling

Optional 

hu: 

Labels should be clear. In the English language, use the following labels for the file selection dialog box fields and lists: 

 

 

Component 

Label 

 

 

Directory text field 

Enter Path or Folder Name 

 

 

Filter text Field 

Filter 

 

 

Directory list 

Folder 

 

 

Contents list 

Files 

 

 

File text field 

Enter Filename:* 

Optional 

hv: 

Optionally, application developers can make this label more instructive and specific, such as Enter File to Open for Open dialog boxes. (see following sections for specific recommendations). 

These labels should be the default labels. If they are not set by default, you need to set them via resources in your application's app-defaults file. 

Recommended 

he: 

When the file selection box is used to specify an existing file (for example, to open a document), the command button is normally labeled Open and it should be the default action. 

Required 

hj: 

When the file selection dialog box is used to specify a new file name (for example, a Save As dialog box), the command button is normally labeled Save and is the default action. This specification ensures the uniform appearance of a file selection box across applications. 

Button Activation

Recommended 

hf: 

If the Update button is activated while a directory is selected in the contents list, the directory is opened, its contents are displayed in the contents list, and the directory text is updated. 

Required 

hg: 

If the Open button is activated while the appropriate file is selected in the contents list, the file is utilized by the application and the file selection box is dismissed. 

Selection and Navigation

Required 

7-12: 

Double-clicking BSelect on an item in the contents list selects that item and activates the default action. In all cases, double-clicking BSelect on a directory in the contents list opens that directory and displays its contents in the contents list (the default action is Open). 

  • When the file selection dialog box is used to choose an existing file, double-clicking BSelect on an appropriate file in the contents List chooses that file and dismisses the file selection dialog box (the default action is Open).

  • When the file selection dialog box is used to choose an existing directory or to specify a new directory or file, the files list should not appear.

Required 

7-13: 

The normal text navigation and editing functions are available in the text components for moving the cursor within each text component and changing the contents of the text. 

These actions provide a convenient way to choose a directory or file name from the corresponding List while focus remains in the Text component. 

Optional 

7-15 

Your application allows the user to select a file by scrolling through the list of file names and selecting the desired file or by entering the file name directly into the file selection text component. Selecting a file from the list causes that file name to appear in the file selection text area. 

This method for selecting a file needs to be consistent across applications. 

Required 

7-16 

Your application makes use of the selection when one of the following occurs: 

  • The user activates the command push button while an appropriate item is selected in the contents List.

  • The user double-clicks BSelect on an appropriate file in the contents list.

  • The user presses Return or Enter while the file name text component has the keyboard focus and contains an appropriate item.

Guidelines for Specific File Selection Dialog Box Uses

The following guidelines apply for specific uses of the file selection dialog box, and should be observed in addition to the more general guidelines.

Open Dialog

Recommended 

hm: 

If the user has opened the application without supplying a file name argument, the Open dialog box should use the user's home directory as the default directory. 

An exception to this rule might be made if a clearly more useful directory can be identified; for example, the icon editor might default to $HOME/.dt/icons. For applications that allow editing, never default to a directory in which the user does not have read and write permission, such as /usr/dt/bin. 

Required 

hn: 

If the user has opened the application with a file name argument, the Open dialog box should default to the directory in which that file resides. 

Save As Dialog

Optional 

ho: 

When using the file selection dialog box in Save As capacity, provide a default name of Untitled, place the location cursor in the file name field and highlight the file name text to create a "delete pending type-in" mode. If the current directory already has a file of that name, create a name Untitled2, and so forth. 

Optional 

hp: 

When using the file selection dialog box in a Save As capacity, add a file name extension if the application supports file typing by extension, and make this extension visible in the file name field. Do not highlight the extension to create a "delete pending type-in" mode, but allow users to modify the extension or delete it explicitly. 

After saving a file using "Save As", the application should use that newly saved file as the current file, and all subsequent edits and saves should apply to that newly created file. 

The Save As dialog should use the same directory in which the current file resides.  

Directory Selection Dialog

Recommended 

hh: 

When the file selection dialog box is used to choose an existing directory (for example, to install a set of files into the chosen directory) or to specify a new directory, the command button should be given an appropriate label, such as Install, Choose, Create, or OK. If this button is activated while the appropriate directory is selected in the contents list, the directory is utilized by the application and the file selection box is dismissed. 

Required 

hi: 

When the file selection dialog box is used to choose an existing directory, there must also be an additional button, labeled Update, that is enabled whenever a directory is selected in the contents list, and opens the directory. This Update button is the default action. 

Optional 

hk: 

When the file selection dialog box is used to choose an existing file, files are shown in the contents list but they are all disabled. Double-clicking BSelect on a disabled file name has no effect.