FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour tMultiget and bLostFocus problem
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM

tMultiget and bLostFocus problem

Posted: Wed Jan 12, 2011 09:01 AM

Hi all,
it is a bit strange problem that didn't exist on the FWH Oct 2009.
if a make (in a multiget) a oGet:bLostfocus:={......} then when the bLostFocus is evaluated the new get value is not still assigned
different from FWH Oct 2009 where the get was assigned.

I tried to bypass the problem with oGet:Assign() after the bLostFocus is evaluated but this method is not available in tMultiget class.

Any ideas ? Thanks in advance.

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: tMultiget and bLostFocus problem

Posted: Wed Jan 12, 2011 09:59 AM
This is the code of LostFocus method in multiget class
Code (fw): Select all Collapse
//----------------------------------------------------------------------------//

METHOD LostFocus( hCtlFocus ) CLASS TMultiGet

   Super:LostFocus( hCtlFocus )

   if ::bSetGet != nil
      Eval( ::bSetGet, GetWindowText( ::hWnd ) )
   endif

   ::nPos = nLoWord( ::SendMsg( EM_GETSEL ) )

return nil

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

Super:LostFocus(...) evaluate bLostFocus codeblock. By this time the buffer is still not assigned to the variable. This is the same code even in 10.07. I do not know why there is any change in the behavior between 10.07 ( or 10.09 ) and now.

In any case try moving the line Super:LostFocus(..) next to the If ::bSetGet .... endif block.

This should give the desired behavior for you. Let us see if this solution works well and has no other undesirable side-effects.

Alternatively, keep the following line as the first line of your bLostFocus code block
Code (fw): Select all Collapse
     Eval( oGet:bSetGet, GetWindowText( oGet:hWnd ) )
Regards



G. N. Rao.

Hyderabad, India
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM

Re: tMultiget and bLostFocus problem

Posted: Wed Jan 12, 2011 10:44 AM

Hi,
moving Super:LostFocus( hCtlFocus ) all seems to runs well.

I checked that LostFocus method is unchanged beetween Fwh oct 2009 and Fwh Nov 2010
so I think this issue is related to other changes in mget or other "core" FWH classes.

Thanks for your quick support.

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: tMultiget and bLostFocus problem

Posted: Wed Jan 12, 2011 11:15 AM
Probably it may not be a good idea to change the class in FWH library.

Instead better we insert this line as the first line of our bLostFocus code
Code (fw): Select all Collapse
   Eval( oGet:bSetGet, oGet:GetText() )
Regards



G. N. Rao.

Hyderabad, India
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM

Re: tMultiget and bLostFocus problem

Posted: Wed Jan 12, 2011 12:40 PM

Yes, I generally avoid to make changes to the fwh classes but this seem to be a bug so a correction of the mget module is needed,
I think the tmultiget has to works with the same tGet logic so the value has to be automatically assigned when the lostfocus is valuated.

Best Regards,



Marco Turco

SOFTWARE XP LLP

Continue the discussion