Consultor Eletrônico



Kbase 20941: How to Keep the Focus on a Window after Attending the Timer
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Unverified

GOAL:

How to keep the focus on a window that has been opened by another window that has a PSTimer that displays a message after every tick.

FIX:

Follow these steps to illustrate normal functionality:

Window A has a button (button 1) that contains
chCtrlFrame:PSTimer:Interval = 2000.
RUN proc.w.

and a PSTimer with a trigger that displays a message.

Proc.w contains a simple object (fill-in).

1) Run that procedure that contains window A.

2) Click button1.

Procedure proc.w is started and the focus shifts to a
new dialog.

3) Click OK in the message that is displayed when the
trigger PSTimer.Tick is fired.

The focus is now in the first window, window A.

To keep the focus in proc.w:

1) Create a window with a handle in window A:

create window hnd
assign parent = current-window.

2) Change the run statement in window A:

run procedure.w persistent (input hnd).

3) Add a define input parameter in proc.w:

Define input parameter hnd as handle.

4) Add next statements in PSTimer.Tick in window A:

Apply "focus" to hnd.
Apply "entry" to hnd.