Returning the focus to the previous control

Returning the focus to the previous control

Postby AHF » Fri Nov 02, 2007 5:37 pm

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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby Antonio Linares » Fri Nov 02, 2007 5:46 pm

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby AHF » Fri Nov 02, 2007 6:02 pm

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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby James Bott » Fri Nov 02, 2007 8:39 pm

>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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby AHF » Mon Nov 05, 2007 10:53 am

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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby Antonio Linares » Mon Nov 05, 2007 12:10 pm

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 59 guests

cron