Focus Problem

Focus Problem

Postby Colin Haig » Sun Nov 25, 2007 1:11 am

To All

I have a window with a buttonbar and one of the buttons is a find button ,
when that is activated a get on the buttonbar is made visible and as the users types in letters an incremental search is done and the browse is refreshed on each keypress - when the enter key is pressed the get is
hidden and the focus is set to the browse - the browse does get focus but them loses it and I cant find which control or if any control has focus - I hit the tab key but there is movement on the other controls.


DEFINE BUTTON oBtn5 of oBar RESOURCE "EYE" ;
FLAT ;
PROMPT 'Find' ;
ACTION(cCode := space(5),oCode:Top(),oCust:SetPos(0),oCust:Show(),oCust:SetFocus());
TOOLTIP('Find Customer')

@ 15,450 GET oCust VAR cCode picture '@!' UPDATE of oBar SIZE 80,20 ;
on change(if(oCust:nLastKey>32,chr(oCust:nLastKey),""),self:cargo:seek(trim(oCust:cText)),;
if(oCust:nLastkey==13,(oCust:Hide(),oLbx:SetFocus(),oLbx:GoToCol(2)),oLbx:Refresh())) ;
FONT oFont ;
PIXEL
oCust:cargo := oCode

Thanks for any ideas

Regards

Colin
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Postby James Bott » Sun Nov 25, 2007 3:29 am

Colin,

I would suggest taking a different approach. Just leave the GET visible and do the search when the users type something in. This is common behavior.

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

Focus

Postby Colin Haig » Sun Nov 25, 2007 4:34 am

Hi James

I have tried leaving the get visible but it did not make any difference -
I have even added a delay after the focus goes to the browse and I can
see the browse get focus and then after the delay it loses focus - I dont what is causing the browse to lose focus.

Regards

Colin
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Postby James Bott » Sun Nov 25, 2007 5:17 am

Colin,

I think we need a small self-contained example to be able to see the problem.

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

Postby Antonio Linares » Sun Nov 25, 2007 8:56 am

Colin,

Try to add this code at the end of the ON CHANGE clause of the GET:

oCust:oJump := oLbx
regards, saludos

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

Postby Colin Haig » Sun Nov 25, 2007 10:40 am

Hi Antonio

Thanks that worked great - still cant understand why the browse
lost focus and what control the focus went to.

Are you using parallels on your mac or vmware to run Vista and XP.

Cheers

Colin
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Postby Antonio Linares » Sun Nov 25, 2007 11:59 am

Colin,

> Thanks that worked great

good :-)

> Are you using parallels on your mac or vmware to run Vista and XP

I run OSX, Vista and Linux natively, all of them, to have the fastest speed :-)

Anyhow, I prefer vmware as I can use the same virtual machines files from Windows, OSX and Linux
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 78 guests