window focus unexpectedly changing

Don Carlson

New Member
Hi everyone. Got a problem I am hoping someone out there has seen and already found a solution for.

Environment: Win2K Progress V9.1C.

We have a main menu program with 3 "widgets": a MS TreeView control, a MS ListView control, and a fill-in. A user can run a child-program from any of the 3 "widgets". The children programs are run persistently. If the user exits the program by choosing the ok button or exit button, which simply apply "close" to the procedure, focus returns where you would expect it, in the main menu control from where the child program was launched. That's the good news . . .

The children program all have an ON F4 END-ERROR statement in them. So we include ON "END-ERROR" of frame, apply "choose" to the Exit button. If a user presses F4, the child program exits back to the main menu, but the focus always changes to what appears to be the first item in the tab-order. Not back to the control that it was in prior to the program exiting! Oddly enough, ALT-F4 does not cause this to happen.

Neither the calling program, nor the child program contain any apply "entry" statements.

Can't find anything on PEG or here or the K-Base that discusses why focus would change when a persistent child procedure exits. Anyone got any ideas?

Thanks in advance!

Don Carlson, Programmer
Computer Software Associates, Inc.
 
do you mean you are telling progress to raise "end-error" when the user presses f4 and then you have a trigger for "end-error"?

if this is the case why not have one trigger for f4 that does what your "end-error" trigger does?

I figure it could be the fact that "end-error" is being raised that confused progress into thinking that an error has occured. Maybe this is why Progress behaves differently when returning to the menu program?
 
Originally posted by dwedgbury
do you mean you are telling progress to raise "end-error" when the user presses f4 and then you have a trigger for "end-error"?

if this is the case why not have one trigger for f4 that does what your "end-error" trigger does?

I figure it could be the fact that "end-error" is being raised that confused progress into thinking that an error has occured. Maybe this is why Progress behaves differently when returning to the menu program?

Thanks for your thoughts. I was thinking along the same lines, but after I posted the question, I found that "GO" raises the same unexpected behavior. On "GO" of frame, apply choose to OK button, and all OK button does is apply "close" to this-procedure.

It seems inconceivable that a user keystroke in a child application could cause it's parent window to change focus WITHOUT being told to do so!

Thanks again!

Don Carlson, Programmer
Computer Software Associates, Inc.
 
Back
Top