Searching Event Tables

After the event loop has read an event, it searches the appropriate event tables to determine what to do based on the event code of the event. The event loop may search two or more event tables, based on the type of panel and the type of item being processed.

The event loop calls et_proc() to search an event table. et_proc() searches the event table, and if the event code is found, its associated event function is called. If the specified event code is not found in the event table and there is an entry for ET_DEFAULT in the event table, this event function is called. If there is no entry in the table for the event code and there is no default event function installed, et_proc() returns a -1 to indicate that it could not call an event function for this event.

The system event table is searched first. If the event code is not found there, the event table for the current process (form editing, choice list editing, etc.) is searched. When editing a form or menu, if the event code is not found in the event table for form editing, the event table for the type of item being processed is searched. These event tables include FLDETP for processing data fields, MNETP for processing menu fields, PUSHETP for processing pushbutton fields, and so on. Table 37.2 shows the event tables used when processing different items in Vermont Views.

The system event table (SYSETP) is provided for context-free event functions. Since the system event table is always searched first, you may install event functions that need to be accessible from any part of your application in this table.

Table 37.2: Event Tables Searched During Processing

Type of Processing Event Tables Searched (in order)
Choice list processing SYSETP, CLETP
Viewing or browsing a window SYSETP, VIEWETP
Dragging a window interactively SYSETP, DRAGETP
Viewing help information SYSETP, HELPETP
Menu processing SYSETP, FMETP, MNETP
Form processing:  
Data field SYSETP, FMETP, FLDETP
List box SYSETP, FMETP, LBOXETP
Memo field SYSETP, FMETP, MEMOETP
Tickertape memo field SYSETP, FMETP, TTMEMOETP
Pushbutton field SYSETP, FMETP, PUSHETP
Radio button field SYSETP, FMETP, RADIOETP
Scrollable region SYSETP, FMETP, SRETP


Home Contents Previous Next