tMultiget and bLostFocus problem

tMultiget and bLostFocus problem

Postby Marco Turco » Wed Jan 12, 2011 9: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
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: tMultiget and bLostFocus problem

Postby nageswaragunupudi » Wed Jan 12, 2011 9:59 am

This is the code of LostFocus method in multiget class
Code: Select all  Expand view
//----------------------------------------------------------------------------//

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: Select all  Expand view
    Eval( oGet:bSetGet, GetWindowText( oGet:hWnd ) )
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: tMultiget and bLostFocus problem

Postby Marco Turco » 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
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: tMultiget and bLostFocus problem

Postby nageswaragunupudi » 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: Select all  Expand view
  Eval( oGet:bSetGet, oGet:GetText() )
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: tMultiget and bLostFocus problem

Postby Marco Turco » 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
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 92 guests