You can create entirely new event tables and install them for use instead of the Vermont Views event tables.
Vermont Views references some system event tables directly, and others indirectly. The system event tables for form processing (FMETP), choice list processing (CLETP), browsing and viewing windows (VIEWETP), dragging windows interactively (DRAGETP), and viewing help information (HELPETP) are always referenced directly. If you replace any of these event tables, the change will affect all forms, choice lists, etc. in your application, regardless of when you replace the table.
You can also change the event tables used by the form editor to process active items on the form (FLDETP, MEMOETP, SRETP, etc). Vermont Views references these tables indirectly, through pointers stored in the data structure for each active item. Vermont Views stores a pointer to an event table in the data structure for each active item on the form. Table 39.1 shows the data structures that contain pointers to event tables, and the initial value assigned to those pointers when the item is defined in code or read from the Designer library.
Because there is a pointer to an event table in each field structure, memo structure, and so on, you can replace event tables for processing these items globally or locally. If you change the event table pointed to by the global FLDETP, for example, all fields created or read from Designer libraries after you replace FLDETP will use the new table. You can also set up a specific field to use a different event table, by modifying the field structure to change the event table pointed to by the structure.
Table 39.1: Structures Containing Pointers to Event Tables
| Type of Structure | Event Table Pointed to |
| Data field | FLDETP |
| List box | LBOXETP |
| Memo field | MEMOETP |
| Menu field | MNETP |
| Pushbutton field | PUSHETP |
| Radio button field | RADIOETP |
| Scrollable region | SRETP |
| Tickertape memo | TTMEMOETP |
You would first need to create the new event table. There are two ways to create an event table. You can define an array of event table structures, such as the ones defined in the Vermont Views header file vv_glob.h. Alternatively, you can call the function et_def() to define the table, and the function et_rplevnt() to insert events into this table. For more information on using et_def() to define a new event table, see Chapter 41, "Processing Events and Keystrokes in Your Code."
To change the event table globally, simply change the value of the event table you want to replace. For instance, to change the data form processing event table FMETP, use the statement:
|
To change the event table used when processing all memo fields, use the following statement:
|
All memo fields created in code or read from Designer libraries after this statement is executed will use the new event table.
To change the event table used when processing a specific item on a specific form, change the event table pointed to by the item. For example, to change the event table used in processing a field named my_field, you would use a code fragment similar to this:
|
If you want to use a specific event table for a particular data form, this can be done in an activate window function. You can use the suspend window function to restore the original event table value. For example, the activate window function would include the code:
|
|
|
|
|
|
|
In your suspend window function, you would restore the original event table with the statement:
|
During data form processing, the system event table (SYSETP) is still searched first. Refer back to Chapter 37, "How Event Processing Works," for more information about the order in which event tables are searched.