Page 1 of 1
xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 8:20 am
by Colin Haig
Hi All
Is there away to detect if a cell in browse has lost focus -
user types something in cell and then uses mouse to click checkbox in next cell - because the user did not press the enter key the
data is not saved
Regards
Colin
Re: xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 9:24 am
by ukoenig
Colin,
You can change the cell-color,
but maybe better to display a error-message,
that the old data still exists ?
Code: Select all
oBrw:aCols[ 1 ]:nEditType := EDIT_GET
oBrw:aCols[ 1 ]:bOnPostEdit := { | oCol, xVal, nKey | ;
IIF( nKey == VK_RETURN, ; // SAVED !!!
( DBSELECTAREA("ABC"), ;
NET_RLOCK( 3, 3 ), ;
("ABC")->LAST := xVal, ;
NET_ULOCK() ), ;
MsgAlert( "Old data : " + CRLF + ; // NOT saved !!!
ALLTRIM(("ABC")->LAST) + CRLF + ;
"not changed !!!", "ERROR" ) ) }
Best regards
Uwe
Re: xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 9:36 am
by Colin Haig
Hi Uwe
bOnPostEdit requires a key stroke to activate - I am looking for when the cell loses focus - when the user types in something then moves
to another cell using the mouse. I want to detect they have moved without using the enter key.
Regards
Colin
Re: xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 12:51 pm
by cnavarro
Have you tried?
oCol:lAutoSave := .T.
Re: xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 2:00 pm
by Colin Haig
Hi Cristobal
I tried your suggestion - thank you - but get the following error
Called from: => TRANSFORM(0)
Called from: .\source\function\VALBLANK.PRG => CVALTOSTR(217)
Called from: C:\newdev\common\xbrowse.prg => (b)TXBRWCOLUMN:ADJUST(8281)
Called from: C:\newdev\common\xbrowse.prg => TXBRWCOLUMN:ADJUST(8350)
Called from: C:\newdev\common\xbrowse.prg => TXBROWSE:ADJUST(963)
Called from: C:\newdev\common\xbrowse.prg => TXBROWSE:INITIATE(861)
Called from: => __OBJSENDMSG(0)
Called from: => HB_EXECFROMARRAY(0)
Called from: .\source\function\HARBOUR.PRG => OSEND(219)
Called from: => HB_EXECFROMARRAY(0)
Called from: .\source\function\HARBOUR.PRG => ASEND(197)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE(669)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT(944)
Called from: => DIALOGBOX(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(275)
Called from: Input2.prg => LFCOURSE(750)
Regards
Colin
Re: xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 3:40 pm
by James Bott
Colin,
What was the actual error?
I suggest creating the simplest possible test program to simplify finding the problem.
James
Re: xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 6:36 pm
by cnavarro
Colin Haig wrote:Hi Cristobal
I tried your suggestion - thank you - but get the following error
Called from: => TRANSFORM(0)
Called from: .\source\function\VALBLANK.PRG => CVALTOSTR(217)
Called from: C:\newdev\common\xbrowse.prg => (b)TXBRWCOLUMN:ADJUST(8281)
Called from: C:\newdev\common\xbrowse.prg => TXBRWCOLUMN:ADJUST(8350)
Called from: C:\newdev\common\xbrowse.prg => TXBROWSE:ADJUST(963)
Called from: C:\newdev\common\xbrowse.prg => TXBROWSE:INITIATE(861)
Called from: => __OBJSENDMSG(0)
Called from: => HB_EXECFROMARRAY(0)
Called from: .\source\function\HARBOUR.PRG => OSEND(219)
Called from: => HB_EXECFROMARRAY(0)
Called from: .\source\function\HARBOUR.PRG => ASEND(197)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE(669)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT(944)
Called from: => DIALOGBOX(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(275)
Called from: Input2.prg => LFCOURSE(750)
Regards
Colin
Fwh version you are using?
In my tests working properly
Re: xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 10:44 pm
by Colin Haig
Hi Crisotbal
I am using FWH 11.05 - I should really upgrade.
Thanks for your assistance
Regards
Colin