xBrowse Cell Lost Focus

Post Reply
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

xBrowse Cell Lost Focus

Post 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
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: xBrowse Cell Lost Focus

Post 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 :?:
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.
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: xBrowse Cell Lost Focus

Post 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
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: xBrowse Cell Lost Focus

Post by cnavarro »

Have you tried?

oCol:lAutoSave := .T.
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: xBrowse Cell Lost Focus

Post 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
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: xBrowse Cell Lost Focus

Post by James Bott »

Colin,

What was the actual error?

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

James
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: xBrowse Cell Lost Focus

Post 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
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: xBrowse Cell Lost Focus

Post by Colin Haig »

Hi Crisotbal

I am using FWH 11.05 - I should really upgrade.

Thanks for your assistance

Regards

Colin
Post Reply