FacetTerm  
 
FacetCorp
 

Customizing FacetTerm Menus


One of the best reasons for installing FacetTerm on a user's terminal is that it brings all of the application programs together under a uniform menu system. The FacetTerm menus allow the user to switch between running programs and to start new programs.

Usually, the system administrator or integrator who sets up a user to run FacetTerm knows the list of programs that the user can run. If this list is built into the "Run" menu, then the user can start new sessions easily. This gives a group of different applications the look and feel of an integrated package.

Different users can have different run menus. This allows each user to have a customized list of applications to run. When FacetTerm starts, it looks in the user's home directory for a directory called .facettext. If it is not there, it looks in /usr/facetterm/localtext for a version of the file that has been customized for this machine. Finally, it looks in /usr/facetterm/text for the factory default file. (Actually, it looks in many different places. Check in the manual.)

To create a customized run menu, first make the directory /usr/facetterm/localtext. Copy /usr/facetterm/text/run_menu to /usr/facetterm/localtext/run_menu. Edit the file /usr/facetterm/localtext/run_menu. You will find a small section of lines for each line on the run menu. Each section contains several entries.

The item_name entry specifies the string that is presented to the user on the menu. When you are creating an item for the run menu, this name should be the one that the user calls the program. Examples:

      item_name=Accounts Receivable
      item_name=Word Perfect
      item_name=e-mail
The item_selection entry tells which letter in the item_name is the selection character. The selection character is usually underlined when the menu is presented to the user. If the user presses this letter, he will select this item (start this program).

The item_action has different meanings, depending on the value of item_type.

The item_type entry tells FacetTerm what to do if this item is selected. If item_type=ft_command, then FacetTerm will execute a command-line command (^W...). The FacetTerm command would be given in item_action. If item_type=program, FacetTerm will start a program on a new window. The program to start is given in item_action. If item_type=menu, FacetTerm will start a sub-menu by using item_action to look for a menu file to start.

The new_window_title entry allows you to specify what title to put on the select menu (and on the top of an AlphaWindows window) for the program that is started by this selection. new_window_size and new_window_position entries only work in AlphaWindows. They allow you to size and position the new window.

It is possible to put in a dialog box to ask the user to enter a file name, a mail destination, or other parameter for the command being executed. There are examples of this in the default run_menu file.

Once you have a modified run_menu to test, bring up the menu with the ^F hot-key and move the cursor over to Run. You should see your new menu there. Move the cursor down to one of your new entries and press <enter>. If the program starts correctly in a new window, press ^F again to be sure that the title you chose appears on the Select menu.

You can customize other menus, also. If you have AlphaWindows terminals, you will probably want to change aw_root_menu. This is the menu that appears when the user clicks on the desktop with the mouse. Add a list of common application programs and remove Shuffle Up and Shuffle Down, if you want. With some experimentation, you should get the list you like.

On the Print menu, you might add entries to print the current screen on different printers. You can do this by setting item_type=fct_command and item_action=xonewprint\r. Then copy the .facetprint script to newprint and edit newprint to have a different printer destination in it.

Anything is possible. You could decide to make the FacetTerm menu the main menu for your application. You could put an entry called "Accounting" on the menu bar with "Payroll", "General Ledger", "Payables", and "Receivables" as menu item names. These could have an item_type of "program" and could start programs or shell scripts to run these functions.

Menu files are documented in detail in the manual. You should read this section before you get to far along. It will give you ideas and possibilities that I have not included here. Two words of caution:

1) Don't make item_name longer than 80 characters
2) Don't use: item_type=menu_program