Page 1 of 1
Returning the focus to the previous control
Posted: Fri Nov 02, 2007 5:37 pm
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
Posted: Fri Nov 02, 2007 5:46 pm
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
Posted: Fri Nov 02, 2007 6:02 pm
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
Posted: Fri Nov 02, 2007 8:39 pm
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
Posted: Mon Nov 05, 2007 10:53 am
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
Posted: Mon Nov 05, 2007 12:10 pm
by Antonio Linares
glad to know it is ok