Progress
Language Tutorial
for Windows


Programming for Events

So far you’ve learned that the user interacts with an application through an interface made up of widgets. The user responds to the interface with events. A widget responds to an event by executing the programmed response, if one exists, followed by the Progress default response.

There is one more important development in the cycle of events and responses: you need a way to suppress default responses. Most of the time, you’ll want to keep the default response, but you’ll also encounter instances when you want to replace the default response with a programmed response.

To suppress a default response, you include the Progress statement RETURN NO-APPLY just before the END statement of your trigger. Later in the tutorial, you’ll see examples of using RETURN NO-APPLY. The tutorial introduces it here because it is an important part of the event-response cycle, which Figure 3–3 illustrates.

Figure 3–3: How an Application Responds to Events

The Progress programming model boils down to these main tasks:

  1. Create your interface.
  2. Code your triggers.

When you create the interface (define, display, and enable widgets), Progress automatically provides all the default behavior the user needs as they interact with that interface. The real work that your application does normally occurs as a response to a specific event from the user. That means that much of your functionality resides inside triggers. A good way to visualize this structure is to think of the code outside of the triggers as the code that creates and controls your interface. The code inside your triggers performs the tasks for which you created the application. The ON statement is the connection between the interface and the functionality inside the trigger.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095