APPLY event TO widget-phraseAn 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 “Handle-based Object Events Reference” section.TO widget-phraseThis 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.Regardless of whether there is a default system action associated with an event-widget pair, you can write a trigger for the pair. The APPLY statement executes a trigger associated with an event-widget pair. If the event-widget pair has a default system action, that action occurs before or after the trigger executes, depending on the event. For more information on default system actions and events, see the next note and the “Handle-based Object Events Reference” section.
The APPLY statement is double-byte enabled. A character-string value specified for the event argument can contain double-byte characters.
If you are using APPLY in an EDITING phrase and expression is a key that causes a GO action (GO, or any key in a list used with the GO-ON option), the AVM does not immediately exit the EDITING phrase but instead processes all the remaining statements in the phrase. If RETRY, NEXT, UNDO RETRY, or UNDO NEXT is executed before the end of the phrase, the AVM ignores the GO and continues processing the EDITING phrase.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |