PreviousNextIndex

APPLY statement

Applies an event to a widget or procedure.

Syntax

APPLY event [ TO widget-phrase ] 

event
TO widget-phrase
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, the AVM 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 NO-LOCK. 
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


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex