WXP version 5
User's Guide

Prompts and Menus

The ability to guide the user through the  rough task of selecting options is critical for most programs.  WXP employs a system of prompts and menus to guide the user to the final product. Even though the menu system can provide access to many types of plots, the command line and resource interface is far more powerful.  There is a balance between providing basic capabilities to the user through the menus and overwhelming the user with choices.

NOTE for Windows 95/98/NT Version -- In all graphics applications, there is no ability to print messages, prompts and menus to standard output.  For these applications, the menus and prompts are disabled.  As a result, all pertinant information must be specified on the command line.

Program Prompts

Many WXP programs prompt the user for information.  A prompt is used when the number of options is fairly limited and explanation is not required.  Each prompt is a request for a resource value.  In some cases, you will enter the exact value for the resource as in a filename.

   /home/wxp/convert/96112205_sao.wxp
   /home/wxp/convert/96112206_sao.wxp

   Enter the surface filename: 96112206

The filename is entered from the list of files.  You can abbreviate the value in some cases as in the above example.

In other cases, you will enter an abbreviation for the resource.

   Display (D) or Postscript (P):

The abbreviations will be clearly listed at the prompt.

Program Menus

If more information is needed in order to select a resource or parameter, a menu is displayed and the selection is from taken from the menu listing.  Menus have a couple of added features.  First, they can be nested so that the user can select more than one parameter to display from within a single program.  For example, you can select to plot temperature for the Midwest.  When you are done looking at this plot, you can select another variable such as temperature or go up a menu level and select a different region. Second, menus often have many more parameters to select than those listed.  The programs have predefined variable types, not all of which can be displayed in a simple menu.  You can still select the variable type but it will not appear on the menu.

When a resource is to be selected via a menu, a list of choices will appear.  Each menu item has a resource value associated with it.  By entering the number from the menu, you are essentially entering that value.  It is just an abbreviation for the value.

           Region Menu

     1: Contiguous US                   --------------------               
     2: New England                     10: Western Canada                
     3: Atlantic                        11: Eastern Canada                
     4: Southeastern                    12: Northern Canada               
     5: Midwestern                      13: North America                 
     6: Southern Plains                 14: Indiana                       
     7: Northwestern                    15: Lafayette                     
     8: Southwestern                  
     0: Return to previous menu         -1: Exit program                  

   Enter the region:

There are several ways of entering data at a menu prompt.  First, you can enter the number associated with the selection.  For example, the Midwest region can be selected by entering "5" at the prompt.  Second, the full menu listing can be there is the menu listing.  You could have entered "Midwestern".  There is also the resource value. To get a list of possible resource values, you can type "?" at the menu prompt:

   Enter the region: ?
   back,us,ne,at,se,mw,sp,nw,sw,--,wc,ec,nc,namer,ind,laf

The values are then listed and the prompt returns.  You can see that the associated value is "mw" so this could have been entered as well.  There are a number of preset regions that don't show up on the menu because of space concerns.  To get a full list of predefined regions, use the "list" command:

   Enter the region: list
    Abbr    Description
   us       Contiguous US                                     
   ne       New England                                       
   at       Atlantic                                          
   ...                                   
   namer    North America
   nhem     North Hemisphere                                  
   shem     South Hemisphere                                  
   hi       Hawaii                                            
   ak       Alaska                                            
   globe    Global
   ... 
   europe   Europe
   easia    East Asia                                           
   ...                               
   aust     Australia                                         
   wpac     West Pacific                                      
   antarc   Antarctica                                        

Often the values are short and mostly easy to remember. As you get more adept at using WXP, you will rarely look at the menu but will almost always enter the resource value or abbreviation.

Finally, there are non-menu resource values that can be selected.  For the region menu, a full plot domain value can be entered.  This really generalizes the use of menus to being interfaces into setting the resource:

   Enter the region: 40,-105,1.4

Here, the values represent the central latitude, longitude and the scale size of the plot (1 is appropriate for regional plots).

Most WXP resources can be set from the WXP prompt.  To view a list of set resources (those with values other than the program defaults), use the "set" command:

   Enter the variable: set
   Set resources
   default: /home/wxp/etc
   file_path: /home/wxp/etc
   data_path: /home/wxp/data
   con_path: /home/wxp/convert
   grid_path: /home/wxp/grid
   raw_path: /home/wxp/raw
   name_conv: name_conv
   current: la

You can then change any of these or set a new one by specifying the resource and its value:

   Enter the variable: set color_map=lblue

The resource is then set and the variable menu prompt returns.  This does not work for all resources because these resources have been already been used (for example filename).  This will work for those resources that have yet to be used such as colors, plot types, etc.

Finally, two more options are available. If the user wishes to exit the program, they can enter "-1" at the menu prompt and the program will terminate immediately and return to either the WXP shell or the operating system prompt. When working with menus and submenus, the user can enter "0" to return to a main menu when within a submenu. If the user is at the top menu level or main menu, this option will exit the program.

Typical Prompts and Menus

Most programs use a similar order to the prompts and menus.


Last updated July 21, 1998