Document revision date: 10 November 2000
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

DECwindows Companion to the OSF/Motif Style Guide


Previous Contents Index

1.5.6.6 Initializing Values in Dialog Boxes

When a dialog box is displayed the second time, you should try to preserve the values for all the fields. For example, when users display a Create dialog box again, they might want to retain most of the values that were already entered. Preserving these values saves users from having to reenter all the information. In the case of a Directory dialog box, users might want to display the same elements the second time, but change the contents of one of the fields, such as the time last modified.

1.5.6.7 Provide a Variety of Selection Controls

Provide selection controls (such as radio buttons or list boxes) and text-entry fields to gather the same information, when suitable. Doing so accommodates different user preferences for entering information. For example, Figure 1-37 shows a dialog box that allows users to customize the size of their windows by either typing in the size in a text field or by selecting the appropriate push button.

Figure 1-37 Provide a Variety of Selection Controls


Be careful, however, to avoid clutter by providing too much variety. Also, do not overwhelm users with too many visual features, such as flashing, bolding, and underlining. In general, avoid using flashing because it distracts the user.

1.5.7 Creating Tab Groups

A tab group consists of any managed or primitive widget that is organized into a traversable group or field. In other words, a tab group is a group of controls that belong together. For example, a set of radio buttons is a tab group. To move from tab group to tab group in a dialog box, users press the Tab key (hence the name tab group).

Organize the controls in your dialog boxes into distinct tab groups. The toolkit makes two distinctions with regard to navigating dialog boxes with the keyboard:

1.5.7.1 Navigating Between Tab Groups

Treat each of the following types of controls as its own tab group:

Follow these general rules for navigating between fields:

Refer to Figure 1_38 and Figure 1-39 to see how the input focus moves from tab group to tab group when users press the Tab key. The location cursor wraps from the bottom right tab group to the top left tab group when users continue to push the Tab key.

Figure 1-38 Use the Tab Key to Move Between Tab Groups


Figure 1-39 Use the Tab Key to Move Between Tab Groups--continued


1.5.7.2 Navigating Within Tab Groups

To move from component to component within a tab group, users press the arrow keys. For example, to move from one item to the next in a series of radio buttons, users press the down arrow key. However, to move from a radio button to the next tab group, users press the Tab key.

Refer to Figure 1-40 to see how the input focus moves from component to component within a tab group when users press the arrow keys. Notice that the location cursor wraps; that is, when users press the down arrow key to go to the last item in a series and then press the down arrow key again, the location cursor moves up to the first item in the series.

Figure 1-40 Use the Arrow Keys to Move Within Tab Groups


1.6 Presenting Text in Dialog Boxes and Other Screen Objects

When creating labels and text for dialog boxes and other screen objects such as menus and title bars, follow these guidelines:

1.7 Creating Title Bars

Title bars are used in both primary and secondary windows.

For primary windows, provide labeling as follows:

For secondary windows, provide labeling as follows:

For more information on naming dialog boxes, see Section 1.2.1.

1.8 Using the Working Dialog Box and the Wait Cursor

Use Working dialog boxes and wait cursors to give the user immediate feedback that your application is in process.

In most circumstances, if the action will take more than 15 seconds, use a Working dialog box to show work in progress. Since the length of time that an action takes is system dependent to a large extent, you might want to make the display of a Working dialog box be a customizable option.

When actions will take less than 15 seconds, let the user know the application is processing by changing the cursor to a wait cursor such as the DECwindows watch cursor. Continue to display the wait cursor until the action is complete. Use a wait cursor for the following types of actions:

Set the wait cursor on all windows where the user is waiting for an application to complete an action. For example, if the application is refreshing a directory, the wait cursor should be set in the directory window as well as all other windows that are visible and pending the completion of that refresh.

Programming Hint



Use the following code example to set a wait cursor for the active window. The #ifdef is used when the application runs on an OpenVMS system. The other include statement applies to both UNIX and Windows NT systems.


#ifdef OpenVMS 
#include <decw$cursor.h> 
#else 
#include <X11/decwcursor.h> 
#endif 
#include <DXm/DECspecific.h> 
 
  /* Wait? */ 
  if ( wait ) 
    /* Set the wait cursor for this window. */ 
    waitCursor = DXmCreateCursor(widget,decw$c_wait_cursor); 
  else XUndefineCursor(XtDisplay(widget), XtWindow(widget));   
 


Chapter 2
Designing Menus and Menu Items

This chapter provides guidelines for designing menus. It supplements the OSF/Motif Style Guide by discussing the following topics:

This chapter also discusses the OSF/Motif File, Selected, Edit, View, Options, and Help menus, and recommends items to add to these menus. In addition, you can include a Windows menu and your own application-specific menus.

2.1 Naming Menus and Menu Items

Use the standard terms for common menus, such as File, Selected, Edit, and Options. In left to right environments, place the menus in the recommended order, with File farthest to the left, followed by Selected, and then Edit. Application-specific menus should follow the Edit menu. Place the View, Options, and Help menus to the right of any application-specific menus. The Options and Help menus should always be farthest to the right. If you include a Windows menu, place it between the Options and Help menus. See Figure 2-1 for an example.

Programming Hint

To position the Help menu at the far right of the menu bar, set XmNmenuHelpWidget to the name of the Help cascade button.

Figure 2-1 Order of Menus in the Menu Bar


Additional menu bar items should be placed after Edit and before Help. When there is a View menu bar item, most additional items should be placed between Edit and View. In this way, users become accustomed to the File, Selected, and Edit menus appearing at the left and the View, Options, and Help menus appearing at the right. Figure 2-2 shows two application-specific menu bar items.

Figure 2-2 Sample Menu Bar with Application-Specific Items


When you are creating your own menus and menu items, avoid giving a menu the same name as a menu item. For example, Paste is an item on the Edit menu, so do not create a Paste menu in the menu bar.

Use verbs or adjectives for your menus and menu items instead of nouns. Verbs and adjectives give users a better idea of what action a command will perform.

Follow the guidelines for text presentation (such as capitalization and punctuation) in Section 1.6.

Use terminology that will be familiar to users. For example, if you are designing a simple drawing tool, avoid terms like chamfer or bevel, but if you are designing a drawing tool for graphic artists, use these terms. Whatever terms you choose, make sure they are distinct from each other. Ask users to review your choices of menus and menu items and to tell you if the terms are clear and distinct.

Give each menu and each menu item a mnemonic. Consider giving the most commonly used menu items accelerators.

Programming Hint

To create a mnemonic and an accelerator, use the following code example:


 
 
object copy_button : XmPushButton 
    { 
        arguments 
            { 
                XmNlabelString      = "Copy"; 
                XmNaccelerator      = "Ctrl<Key>Insert"; 
                XmNacceleratorText  = "Ctrl+Ins"; 
                XmNmnemonic         = keysym("C"); 
            }; 
    }; 
 

For information on capitalization of menu items, see Section 1.6.

2.2 Organizing Menus and Menu Items

The way you organize your menus and menu items depends on your application. Choose the most appropriate guidelines from the following list to help you:

Consider providing a menu map, either on line or in hardcopy form. Some products provide one map of all menus and menu items, while others provide separate diagrams for each menu and its associated submenus. Figure 2-3 shows a map for one menu and its associated submenus.

Figure 2-3 A Menu Map


2.3 Using Ellipses in Menu Items

Use a horizontal ellipsis (...) to indicate that pushing the button invokes a dialog box or window that requires some action on the part of the user. For example, use an ellipsis with the Print menu item if it invokes a dialog box in which users must provide printer information before a file can be printed.

Do not use ellipses with the Help push button or Help menu item since Help does not require any action. (For information on designing online help, see Chapter 5.)

Do not take short cuts when providing ellipses in cascade buttons. Always use ellipses in cascade menu items. Figure 2-4 shows the appropriate way to use ellipses with cascade buttons.

Figure 2-4 Ellipses with Cascade Buttons


2.4 Disabling Menu Items

At a given time, your application can make a menu item unavailable to users; that is, it can disable the menu item. Users cannot choose a disabled menu item. Figure 2-5 illustrates a disabled menu item.

Figure 2-5 A Menu with a Disabled Menu Item


Programming Hint

To disable a menu item, call XtSetSensitive with the widget ID of the widget.

You can allow users to display a menu or submenu in which all items are disabled. With such a display, users can see what features your application provides. (This guideline does not necessarily apply to pop-up menus; for guidelines on pop-up menus, see Section 2.5.2.)

If your application does not support a standard menu item, do not display that menu item at all. For example, if your application does not support the Select All menu item, do not include Select All in a menu.

Use the following guidelines to determine whether to disable a menu item:

Some menu items invoke dialog boxes; your decision to disable such menu items depends on whether the dialog box that is invoked is modal or modeless:


Previous Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement  
5637PRO_003.HTML