DbCombo LostFocus() Do not Work

Post Reply
User avatar
Ugo
Posts: 283
Joined: Sat Oct 15, 2005 6:40 am
Location: Turin, Italy

DbCombo LostFocus() Do not Work

Post 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.
Ciao, best regards,
Ugo
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post 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
User avatar
Ugo
Posts: 283
Joined: Sat Oct 15, 2005 6:40 am
Location: Turin, Italy

Post by Ugo »

James Bott wrote:Thanks for finding that and a fix.
Thanks to you for the test and the improvements :)
Ciao, best regards,
Ugo
User avatar
Ugo
Posts: 283
Joined: Sat Oct 15, 2005 6:40 am
Location: Turin, Italy

Post 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 :(
Ciao, best regards,
Ugo
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post 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
User avatar
Ugo
Posts: 283
Joined: Sat Oct 15, 2005 6:40 am
Location: Turin, Italy

Post 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.
Ciao, best regards,
Ugo
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post 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
User avatar
Ugo
Posts: 283
Joined: Sat Oct 15, 2005 6:40 am
Location: Turin, Italy

Post 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:
Ciao, best regards,
Ugo
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Ugo,

Glad to hear you got it working.

James
Post Reply