FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse Cell Lost Focus
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 08:20 AM

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

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 09:24 AM
Colin,

You can change the cell-color,
but maybe better to display a error-message,
that the old data still exists ?

Code (fw): Select all Collapse
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 :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Re: xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 09:36 AM

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

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 12:51 PM

Have you tried?

oCol:lAutoSave := .T.

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Re: xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 02:00 PM

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

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 03:40 PM

Colin,

What was the actual error?

I suggest creating the simplest possible test program to simplify finding the problem.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 06:36 PM
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
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Re: xBrowse Cell Lost Focus
Posted: Tue Feb 25, 2014 10:44 PM

Hi Crisotbal

I am using FWH 11.05 - I should really upgrade.

Thanks for your assistance

Regards

Colin

Continue the discussion