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

2.5 Designing Pop-up Menus

Pop-up menus provide users with shortcuts for accessing pull-down menu items.

Because pop-up menus appear at the current pointer position when MB3 is pressed, users do not need to move the mouse very far. Pop-up menus allow users to keep their attention focused on their work while choosing an action. Invoking functions exclusively from pull-down menus and dialog boxes can require extensive mouse movements, resulting in lower productivity.

2.5.1 Characteristics to Give to Pop-up Menus

Design the pop-up menus to have the following characteristics:

Figure 2-6 Pop-up Menu


Organize pop-up menus in one of the following manners:

Include the most frequently used functions of your applications in pop-up menus. Pop-up menus may contain a heterogeneous group of functions. Because pop-up menus act as accelerators, they require less rigid categories of items than do pull-down menus.

There are two ways to implement pop-up menus:

2.5.2 Determining the Actions of Pop-up Menus

Have items in a pop-up menu act on the current selection (if there is one), according to the following guidelines:

Make your application do one of the following two things if users have not selected any items:

2.5.3 Choosing Between a Pop-up Menu or a Control Panel

Pop-up menus provide users with quick and direct access to application functions. Control panels and modeless dialog boxes that contain push buttons perform a similar role. Use pop-up menus when users are focusing on the work area, and when moving the mouse between the control panel and work area would be distracting. Use a control panel or a modeless dialog box when users want the controls to be constantly visible. You can also use tear-off menus to give the user the choice of keeping the controls visible. (See Section 2.6 for information about tear-off menus.)

2.5.4 Designing Pop-up Menus with Submenus

When combining pop-up menus with submenus, follow these guidelines:

Figure 2-7 illustrates a pop-up menu with a submenu.

Figure 2-7 Pop-up Menu with a Submenu


2.6 Designing Tear-off Menus

A tear-off menu is one that can be torn off into a secondary window. After the menu is torn off, the user can position it and use it in the same way as a dialog box.

When menus are torn off, they appear in a separate window that can be directly accessed. Tear-off menus should be used when elements in a menu can be activated many times in succession. Pull-down, option, cascade, and pop-up menus can all become tear-off menus.

For example, the View pull-down menu, which can contain different views as well as Expand and Collapse items, is a good candidate for a tear-off menu. Most Options pull-down menus, which are used infrequently, might not be appropriate for tearing off. However, Options menus for setting the font family and size for desktop publishing applications are good candidates for becoming tear-off menus.

You should avoid creating tear-off menus from pop-up menus that are context sensitive, with items changing depending on the location of the pointer.

Programming Hint

To set the tear-off attribute of a menu, set the XmNtearoffModel resource for the pull-down menu:


 
 
XmPulldownMenu 
    { 
        arguments 
            { 
                XmNtearoffModel = XmTEAR_OFF_ENABLED; 
            }; 
    }; 
 
 

2.7 Items in the File Menu

The File menu provides commands that allow users to manage files. Place the File menu to the far left in the menu bar (in left to right environments), and give it a mnemonic of F. The mnemonic allows a user to press a single letter on the keyboard in order to select a menu item. Indicate the mnemonic with an underscore.

Motif recommends the following menu items for the File menu:

You can improve the usefulness of the File menu by adding the following items:

Figure 2-8 shows a File menu with Digital's additional menu items in the recommended order.

Figure 2-8 A File Menu and Its Menu Items


Group the menu items according to the following:

The functions of the File menu items are as follows:

New

The New menu item must open a new file in the current window. It must clear existing data from the client area and update the current file name. If users specify a new file name, you can display the file name in the title area or in a status area with a full pathname. If they do not specify a file name, display the term "Untitled" in the title area. Digital suggests that if you give New an accelerator, make the accelerator Ctrl+N.

To accommodate users who already have a file open when they choose the New menu item, have your application display a question message box that asks if users want to save the file. Figure 2-9 shows a question message box that does this.

Open...

The Open menu item must open an existing file. When users click on this item, it must bring up a dialog box that prompts users for the name of the file. Digital suggests that if you give Open an accelerator, make the accelerator Ctrl+O.

To accommodate users who already have a file open when they choose another file to be opened, you can do either of the following:


  • Have your application display an Open File dialog box with a check button that asks if users want to open the file in a new window. Figure 2-10 shows an example of such a dialog box.

    Figure 2-10 An" Open in New Window" Check Box in an Open File Dialog Box


    Include...

    Make the Include menu item add the contents of a specific file to the currently opened file. When users choose Include, generate a File Selection dialog box and add the included material at the current insertion point.

    Import...

    The Import menu item is similar to Open, except that it converts the format of the specified file to the native format of the application. Users need to supply both the name of the file to import and the current format of that file.

    Save

    The Save menu item must save the currently opened file without removing it from the client area. If users have not already named the currently opened file, Save must generate a Save As... dialog box that prompts users for a file name. Digital suggests that if you give Save an accelerator, make the accelerator Ctrl+S.

    Save As...

    The Save As menu item must save the current file under a new name without removing it from the client area. It must also update the name of the file in the title bar or status area. Save As must generate a dialog box that prompts users for a file name. Figure 2-11 shows a Save As dialog box that not only allows users to save a file by typing a name in the Selection field, but also allows users to save a file in different formats.

    If your application runs on an operating system that does not save multiple versions of a file (for example, UNIX or Windows NT operating systems), you can have a message box displayed to warn users whenever saving a file with the name they specified will cause the application to overwrite an existing file. If your application will run on a variety of platforms, you could make the display of this warning message customizable.

    When users choose Save As, they usually want to keep the newly named file in the same directory as the current file. If you use a file selection box in a Save As operation, initially set the directory to match the directory of the open file. If the user has performed a Save As operation before, leave the directory in its previous state.

    Figure 2-11 A Save As Dialog Box That Allows Users to Save in Different File Formats


    Revert

    Make the Revert menu item display the last saved version of the current file. This menu item deletes all the work done since the user last saved the file. If the operating system (for example, the OpenVMS operating system) supports multiple versions, consider allowing users to perform multiple Revert actions. Disable the Revert item if there is nothing to revert in the application.

    Figure 2-12 shows a dialog box displayed by activating the Revert menu item.

    Figure 2-12 A Revert Dialog Box


    Export

    The Export menu item is similar to Save As, but causes the application to convert the file format from the native application format to a different one. Users need to specify both the name of the file to be exported and the new format that they want the application to convert the file to.

    Print

    The Print menu item must print the current file using the current settings of a Print dialog box without displaying the box.

    Print...

    Make the Print menu item generate a Print dialog box. For information on a Print dialog box, see Section 6.1. Digital suggests that if you give Print an accelerator, make the accelerator Ctrl+P.

    Close

    The Close menu item must close only the current primary window and its associated secondary windows; that is, the window family. You are encouraged to supply this menu item for applications with more than one primary window so that users can remove a window without going to the window menu on the border or without running the Motif window manager. Make Close perform the same action as the Close menu item from the window menu. Digital suggests that if you give Close an accelerator, make the accelerator Ctrl+C.

    Closing the last primary window is the same as exiting the application. Use the following guidelines to help you decide what constitutes the last primary window:

    If users can lose data by closing the last window, provide a message box that prompts users to save changes.

    Exit

    The Exit menu item must end the current session and remove all windows associated with that application. Exit is equivalent to closing the last primary window of your application. To accommodate users who want to exit, but have not saved current changes to a file, generate a message box that prompts users to save changes.

    2.8 Items in the Selected Menu

    The Selected menu is optional. It contains items that refer to the selected objects in the window. For example, in a mail application, the selected objects could include drawers, folders, or messages. The user would select a series of mail folders and then display the Selected menu. The menu items would apply to the selected folders.

    Figure 2-13 shows a standard menu bar that contains a Selected menu with seven menu items. You can use different menu items that are appropriate for your application.

    Figure 2-13 A Selected Menu and Its Menu Items


    Note that the File menu differs from the Selected menu. The File menu contains operations for the application as a whole, as well as file-like actions; the Selected menu items apply only to those objects that the user has just selected.

    If an object can be opened in one of several views, consider using a cascade menu for the Selected menu item. For example, if you want the user to be able to open a directory in either an icon or tree view, use a cascade menu instead of a generic Open menu item.


     
        Open-> Icon View 
               Tree View 
     
    

    2.9 Items in the Edit Menu

    The Edit menu provides commands that allow users to manipulate text or graphics within a file and between files. Place the Edit menu to the right of the File menu, or Selected menu if one is defined, in left to right environments, and give it a mnemonic of E.

    Motif recommends the following items in the Edit menu:

    You can enhance the usefulness of this menu by adding the following items:

    Figure 2-14 shows an Edit menu with the additional menu items.

    Figure 2-14 An Edit Menu and Its Menu Items


    Group the menu items according to the following:

    The functions of the Edit menu items are as follows:

    Undo (Alt+Delete), Redo

    The Undo menu item must reverse the effects of a previous operation. The Redo menu item reverses the effects of an Undo operation.

    There are two forms of Undo --- single-level and multilevel --- as follows:

    When an Undo operation is not possible in a given context, disable the Undo menu item. For example, when users open a file, keep the Undo menu item disabled until they make a change to the file. If your application does not support the Undo function, do not display the Undo menu item in the Edit menu.

    You can make the Undo operation more specific by altering the menu item for Undo as the function changes. For example, change the label of the menu item to any of the following when appropriate:

    Once a user operation is undone, have your application support redoing the operation. For example, change the label of the menu item to any of the following when appropriate:

    Cut (Remove)

    The Cut menu item must transfer selected information to the clipboard and delete the information from your application. Decide whether the area that was occupied by the removed data is left blank or whether the remaining data fills the space. Usually graphics applications leave the space blank, while text applications fill the space with the remaining text.

    Copy (Shift+Remove)

    The Copy menu item must transfer the selection to the clipboard without removing the original data from the client area. Do not allow this action to alter data in your application.

    Paste (Insert Here)

    The Paste menu item must copy data from the clipboard into the application. When there is more than one possible destination for the paste, use the following guidelines:

    Decide whether the pasted data is reformatted to fit in the client area. Text applications usually reformat the pasted data to fit into the margins of the text field; graphics applications usually do not.

    Do not allow Paste to affect the contents of the clipboard.

    In addition to the Edit menu items, you should implement the Motif drag-and-drop functions.

    Clear

    The Clear menu item must delete the selection without copying it to the clipboard. The Clear menu item does not compress the remaining data to fill the space that was occupied by the cleared data. Users must be able to undo a clear operation.

    Delete

    The Delete menu item must remove the current selection without copying it to the clipboard. Make Delete compress the remaining data to fill the space that was occupied by the cleared data. Allow users to undo a delete operation.

    Find...

    The Find menu item enables users to search for an object that they specify. When they select the Find menu item, make a search dialog box appear.

    Select All

    Make the Select All menu item select all the data in the file, not just the data that is currently visible.


    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_004.HTML