Progress
Language Tutorial
for Windows
Event Types
Earlier, the tutorial defined any user input as an event. All keystrokes are events. All mouse interactions are events. It’s time to expand the definition of events. Progress recognizes two types of events: event actions and event functions. An event action is any simple user interaction, like a single keystroke or a simple mouse interaction. An event function is an abstraction of one or more event actions.
For example, on some platforms F1 invokes the help system. On other platforms F2 invokes the help system. F1 and F2 are both event actions, but both invoke the same function (in this example). Instead of writing code for the event action, you can write equivalent code using the Progress keyword that specifies the function. In this case, the keyword is HELP. HELP is an event function:
The first trigger relies on the event action, while the second trigger relies on the event function. For any particular widget, you can write a trigger for either the event action or the event function, but not for both. However, you should write your triggers for event functions wherever possible because:
For these reasons, this tutorial uses only event functions.
For every type of widget, Progress has a default response for every event that the widget can receive. This means that when you display widgets, Progress takes care of much of the normal activity the user would have with a widget. The events that you want to keep track of explicitly are those that:
You’ve already seen the syntax for the ON statement, which handles events that execute trigger code. Now, examine this partial syntax for the WAIT-FOR statement.
The WAIT-FOR statement translates to “on this widget-event pair, unblock execution.” The result is that the user moves into another part of the procedure or completes the procedure.
Important Event Functions
Table 3–3 defines some important event functions that you’ll use frequently.
Event Categories
There are literally hundreds of events, so the Progress documentation uses some terms to refer to groups of related events. Table 3–4 describes the categories.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |