Consultor Eletrônico



Kbase P16651: Why does a frame keyboard event triggers appear not to fire
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   6/25/2003
Status: Unverified

FACT(s) (Environment):

Windows

FACT(s) (Environment):

Progress 9.x

SYMPTOM(s):

Frame keyboard event triggers appear not to fire properly?

Defining the following frame CTRL-W keyboard trigger:

ON CTRL-W OF FRAME DEFAULT-FRAME DO:
MESSAGE "CTRL-W"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.

The trigger does not fire when CTRL-W are pressed.

CAUSE:

The trigger will not fire because the frame object itself is not a direct user input (or a keyboard event trigger) target.

FIX:

Use the ANYWHERE option of the ON statement to propagate the event to all contained widgets in the frame. Propagating the keyboard event to all the widgets contained in the frame forces the trigger to fire:

ON CTRL-W OF FRAME DEFAULT-FRAME ANYWHERE DO:
MESSAGE "CTRL-W"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.

Note that the above trigger will not fire if the frame is totally empty and does not contain at least one child widget that accepts user interface or keyboard event triggers.