How Menus Are Implemented

In the Vermont Views system, menus and sub-menus are implemented as menu forms. A menu form is a special data structure that contains all the information necessary to display and process a menu. The same structure is used for data forms. Because menus and data forms use the same form structure, many of the same management variables and options are available for both.

Just as a data form has data fields for collecting different types of data, a menu form has menu fields. A menu field is defined for each selection that you want to appear on the menu form. The menu field structure contains information about the text that is to appear for the menu field, the menu action function associated with that field, and other information.

Menu fields share a number of common structure members with the structure for data fields. Many of the options and features available for data fields are also available for menu fields.

Each type of form item has its own data structure. For example, Vermont Views defines a background text structure, a background line structure, and a background box structure, in addition to the menu field structure described above. Each structure holds information about the appearance and the behavior of the item.

To keep track of what items are associated with the form, the Vermont Views system builds two linked lists of items. One linked list contains the menu fields. The other list contains the background or static items on the menu form. Pointers to these two lists are placed in the menu form structure; thus, the menu form structure contains a complete reference to all items and background on the menu form.

You do not need to learn the details about these structures to learn how to customize menus. Vermont Views maintains the information in the structures for you. You just call the provided functions to specify how you want the form or form items to look and behave. If you would like more information about the structure definitions used by Vermont Views, see the "Structures" section of the Function Reference.


Home Contents Previous Next