User Interface

Mouse: The mouse is only supported under PCDOS. To learn how to enable the mouse see Chapter 43, "The Mouse (PCDOS Only)."

General: When a user presses a key or clicks the mouse, Vermont Views searches event tables to determine what to do. Event tables are made up of entries that associate a key press or mouse click (an event code) with an event function. There are event functions to move to the next field, move to the previous field, move to the last field on the form, move to the first field on the form, and many other actions. You can add your own event functions to provide additional functionality.

Once the form has been initialized and displayed, the form editor enters an event loop, waiting for the user to press a key or click the mouse. Mouse events and other events are posted in the global event queue. Keystrokes are stored in the keyboard buffer.

The form editor checks the event queue first, to see whether an event has been posted. If an event is present, the editor looks up that event code in the event table and calls the associated event function. If there are no events, the editor then checks the keyboard buffer to see if a key has been pressed.

If the user has pressed a key, the editor looks up that keycode in the event table and calls the associated event function. If no key has been pressed, the editor continues to wait for user input.

The form editor searches for the event code or keycode in several different event tables. The form editor first searches for the event code in the system event table. If the event code is found, the appropriate function is called. If the event code is not found, the form editor searches the form event table for the event code. If found, the appropriate function is called. If the event code is not found, the form editor searches the event table for the type of item being processed (such as the field event table or the memo event table). If the event code is found, the appropriate function is called. If the event code is not found, the default event table function is called (that is, the event function assigned to the event code ET_DEFAULT). If the event is a key press, the default function checks if the key pressed is a valid character for the current position in the field, and if it is, displays it in the field. If mnemonic character field selection is enabled for the form, the default function also determines if the keycode represents a valid selection character combination for a field on the form. If so, that field is selected. If the keystroke is not valid, it is not printed and the bell is sounded. (Sounding the bell on errors is an option and can be turned off.)

You can modify event tables by changing the event assignments. You can also write your own event functions and install them in the event table to provide the user with additional capabilities.

To see the default event code-event function assignments for the data form and field event tables look in the "Event Tables" section of the Function Reference. To learn more about modifying event tables and writing event functions, see Chapter 39, "Installing Event Functions and Modifying Event Tables." In addition, it is helpful to know how the form editor works and what functions you can call to assist you in moving between fields and accessing field and form information. See Chapter 29, "How Form and Menu Processing Works," and Chapter 34, "Getting and Updating Data in the Form," for this information.


Home Contents Previous Next