FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Get class and focus
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Get class and focus
Posted: Mon Mar 05, 2012 02:11 PM

Hello,

A small question ?

How can I read which GET has the clause ?
I want to do make a jump to another screen but I need to restore the focus on the right GET.

Thanks in advance.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: Get class and focus
Posted: Mon Mar 05, 2012 03:18 PM
Hi,

Code (fw): Select all Collapse
hFocus:= GetFocus()

.....  // blah, blah, blah...

SetFocus(hFocus)


Regards
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Get class and focus
Posted: Mon Mar 05, 2012 04:25 PM

Michel,

nAt = AScan( oDlg:aControls, { | o | o:hWnd == GetFocus() } )

...

oDlg:aControls[ nAt ]:SetFocus()

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 55
Joined: Fri Jul 08, 2011 06:43 AM
Re: Get class and focus
Posted: Mon Mar 05, 2012 07:16 PM
Michel

Changing focus seems always to be dificult and unprecditable.

I have much better results with :

Code (fw): Select all Collapse
*****************************************************************************************
function xSetFocus( oObx )
**************************
// function from local.fivewin.english 4/1/2003 Kleyber Derick
local oTempo:=""
local lGet := oObx:ClassName $ "TGET TMULTIGET"
define timer oTempo interval 10 of oObx:oWnd ;
  action (oObx:SetFocus(), IIF(lGet , oObx:SetPos(0) , ), oTempo:Deactivate() )
activate timer oTempo

return nil
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Get class and focus
Posted: Mon Mar 05, 2012 07:42 PM

Hello guys,

Thanks a lot for all you help.

I'll be trying out your suggestions.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Continue the discussion