Page 1 of 1

DbCombo LostFocus() Do not Work

Posted: Mon Jul 30, 2007 8:02 am
by Ugo
Dear friend,
the method LostFocus in DbCombo CLASS do not work fine,
is impossible to execute any instruction into a bLostFocus block!
I modified the LostFocus method
this is the new method:

Code: Select all

//----------------------------------------------------------------------------//

METHOD LostFocus( hWndGetFocus ) CLASS TDBCombo

   local nAt := ::SendMsg( CB_GETCURSEL )

   if nAt != CB_ERR
      ::nAt = nAt + 1
      Eval( ::bSetGet, ::aItems[ ::nAt ] )
   else
      Eval( ::bSetGet, GetWindowText( ::hWnd ) )
   endif

   ::cSearchKey:=""
   
   Super:LostFocus( hWndGetFocus )

return nil

//----------------------------------------------------------------------------//
for me work fine.

Posted: Mon Jul 30, 2007 1:14 pm
by James Bott
Ugo,

Thanks for finding that and a fix. A better, and simpler, fix is this:

Code: Select all

METHOD LostFocus( hWndGetFocus ) CLASS TDBCombo
   ::cSearchKey:=""
return super:LostFocus()
Regards,
James

Posted: Mon Jul 30, 2007 1:40 pm
by Ugo
James Bott wrote:Thanks for finding that and a fix.
Thanks to you for the test and the improvements :)

Posted: Mon Jul 30, 2007 5:15 pm
by Ugo
James Bott wrote:Thanks for finding that and a fix. A better, and simpler, fix is this:

Code: Select all

METHOD LostFocus( hWndGetFocus ) CLASS TDBCombo
   ::cSearchKey:=""
return super:LostFocus()
James,
after the new method i have many problem with DbCombo! :(
I replace the previous and work fine :)

The problem is had to the dbf-code variable, to set in startup to spaces and after to have selected an item it becomes numerical :(

Posted: Mon Jul 30, 2007 6:38 pm
by James Bott
Ugo,

I am not seeing your problem or, maybe I don't understand it.

What is the date of your \source\classes\dbcombo.prg file?

James

Posted: Tue Jul 31, 2007 5:03 am
by Ugo
James Bott wrote:I am not seeing your problem or, maybe I don't understand it.

What is the date of your \source\classes\dbcombo.prg file?
James,

my version is "FWHX 7.04" and dbcombo.prg is dated 2006/07/06.

Posted: Tue Jul 31, 2007 2:55 pm
by James Bott
Ugo,

>my version is "FWHX 7.04" and dbcombo.prg is dated 2006/07/06.

OK, I am using the same one. Can you create a small test program that shows the problem?

Regards,
James

Posted: Thu Aug 09, 2007 2:35 pm
by Ugo
James Bott wrote:Thanks for finding that and a fix. A better, and simpler, fix is this:

Code: Select all

METHOD LostFocus( hWndGetFocus ) CLASS TDBCombo
   ::cSearchKey:=""
return super:LostFocus()
Dear James,
now work fine with your new LostFocus method :D

I do not know why in first test not work!
i'm sorry! :oops:

Posted: Thu Aug 09, 2007 2:46 pm
by James Bott
Ugo,

Glad to hear you got it working.

James