by nageswaragunupudi » Sun Nov 25, 2007 10:34 am
With the following 3 changes TXBrowse inline Edit ( edittype 1 singleline ) seem to be working reliably.
- Code: Select all Expand view
METHOD CancelEdit() CLASS TXBrowse
<... code ...>
// oCol:oEditGet:nLastKey := VK_RETURN // comment this line
< ... code ...>
return nil
//--------------------------------------------------------//
METHOD Edit( nKey ) CLASS TXBrwColumn
< .... code .... >
// ::oEditGet:bLostFocus := { || ::PostEdit() } // oldcode <--------
::oEditGet:bLostFocus := { || ::PostEdit(,,VK_ESCAPE) } // new coce <----------
< .....code......>
return .t.
//----------------------------------------------------------//
METHOD PostEdit( xValue, lButton, nLastKey ) CLASS TXBrwColumn // new code <----
// METHOD PostEdit( xValue, lButton ) CLASS TXBrwColumn // old code <-----
< ... code .. >
do case
case ::nEditType == EDIT_GET
If ::oEditGet != nil
// new code insert - begin
if nLastKey != nil
::oEditGet:nLastKey := nLastKey
endif
if ::oEditGet:nLastKey == VK_ESCAPE
::oEditGet:undo()
::oEditGet:Refresh()
endif
// new code insert - end
Eval( ::bOnPostEdit, Self, Eval( ::oEditGet:bSetGet ), ::oEditGet:nLastKey )
lGoNext := ( ::oEditGet:nLastKey == VK_RETURN )
::oEditGet:End()
::oEditGet := nil
endif
< ... further code ...>
Regards
G. N. Rao.
Hyderabad, India