Progress
Language Reference


APPLY Statement

Interfaces
OS
SpeedScript
All
All
Yes

Applies an event to a widget or procedure.

SYNTAX

APPLY event [ TO widget-phrase ] 

event

An expression whose value is the key code or event name that you want to apply. A special value of event is the value of the LASTKEY function. The LASTKEY function returns the keycode for the last event read from the user (that is, from the keyboard or mouse) or the last character read from an input file. The value event can be either a character-string value (event name) or an integer (key code) expression. For more information on default system actions and events, see the Events Reference.

TO widget-phrase

Specifies a widget or procedure to which the event is applied.

EXAMPLE

This procedure shows how to use the APPLY statement to create keyboard accelerators. When you run this procedure you can invoke the trigger block attached to the order-but button by choosing the button directly or by pressing F10 in the Name field. When you press F10, Progress sends the CHOOSE event to the button. This is equivalent to choosing the button with the mouse.

r-apply.p
DEFINE BUTTON order-but LABEL "Order"
   TRIGGERS:
      ON CHOOSE
         DO:
            FIND FIRST Order OF Customer NO-ERROR.
            IF AVAILABLE(Order)
            THEN UPDATE Order WITH FRAME upd-dlg
                     VIEW-AS DIALOG-BOX TITLE "Update Order" SIDE-LABELS.
         END.
   END TRIGGERS.

FORM
   order-but Customer.Name WITH FRAME x.
   
ON F10 OF Customer.Name 
   DO:
      APPLY "CHOOSE" TO order-but IN FRAME x.
   END.
   
FIND FIRST Customer.
DISPLAY order-but Customer.Name WITH FRAME x.
ENABLE ALL WITH FRAME x.

WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW. 

NOTES

SEE ALSO

ON Statement, Widget Phrase


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