Consultor Eletrônico



Kbase P20431: Message statement appears to cause FOCUS to return to the w
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   3/5/2003
Status: Unverified

FACT(s) (Environment):

Windows

FACT(s) (Environment):

Progress 8.3E

SYMPTOM(s):

MESSAGE statement causes FOCUS to go to last run windows.

Main.w runs win1.w and win2.w respectively. Pressing a button on Win1.w executes a MESSAGE statement with the UPDATE option and FOCUS shifts to Win2.w.

CAUSE:

Since the following code included from {src/adm/template/windowmn.i}

IF VALID-HANDLE({&WINDOW-NAME}) THEN DO:
ASSIGN CURRENT-WINDOW = {&WINDOW-NAME}
{&WINDOW-NAME}:KEEP-FRAME-Z-ORDER = YES
THIS-PROCEDURE:CURRENT-WINDOW = {&WINDOW-NAME}.
executes last in win2.w. This makes win2.w the "CURRENT-WINDOW" and causes the FOCUS to return to win2.w when MESSAGE statement with the UPDATE option is executed through the CHOOSE of a button on win1.w.

FIX:

Following two solutions are available:

1. Force FOCUS to follow the ENTRY event by adding trigger code:

ON ENTRY OF {&WINDOW-NAME} DO:
ASSIGN CURRENT-WINDOW = SELF NO-ERROR.
END.

1. Use the IN WINDOWS option at the end of the MESSAGE statement:

MESSAGE "Some Message Text"
VIEW-AS ALERT-BOX WARNING BUTTONS OK-CANCEL TITLE "Some Title" UPDATE lVariable AS LOG IN WINDOW WindowName .