Returning the focus to the previous control

Post Reply
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Returning the focus to the previous control

Post by AHF »

Hi,

When I have 2 browses in a window and I press a button when it returns it doesn't give the focus to the previously focused control but instead always to the ::acontrols[1].

It seems to be a bug.

Anyone knows turn around ?

Antonio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Antonio,

When you click a button the focus is given to the button before firing its action. What you can do is give the focus to the browse that you want, later on:

... BUTTON ... ACTION ( ..., SetFocus( oBrowse1:hWnd ) )

or use oBrowse2 instead of oBrowse1 there
regards, saludos

Antonio Linares
www.fivetechsoft.com
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Post by AHF »

Antonio,

The explanation below demonstrates what I mean. It works fine on win16 but as previuously discussed the process win32 is handling focusing it's totally diferent:

b:bgotfocus := {... configure buttons in the window etc. to recognize this browse is active (focused)}

c:bgotfocus := {same for the seconed browse, it configures all the buttons in the window to know that this is the active browse.}

The problem is that every time I click a button it always gives the focus to the first browse before it runs the ACTION of the button although the second it's focused before clikc the button.

Antonio
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

>The explanation below demonstrates what I mean. It works fine on win16 but as previuously discussed the process win32 is handling focusing it's totally diferent:

Are you comparing the same version of FW compiled as both 16bit and 32bit? If not, then it may be due to a change in a newer version of FW. If yes, then it is a difference in Windows which you will have to code around.

Can you provide a VERY small example showing the problem?

James
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Post by AHF »

Sorry it was my mistake as the button class had been altered in order to setfocus to mdichild before action of the button. Problem solved.

Thanks
Antonio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

glad to know it is ok :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply