xBrowse Cell Lost Focus

xBrowse Cell Lost Focus

Postby Colin Haig » Tue Feb 25, 2014 8: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
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: xBrowse Cell Lost Focus

Postby ukoenig » Tue Feb 25, 2014 9:24 am

Colin,

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

Code: Select all  Expand view

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

Re: xBrowse Cell Lost Focus

Postby Colin Haig » Tue Feb 25, 2014 9: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
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: xBrowse Cell Lost Focus

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

Re: xBrowse Cell Lost Focus

Postby Colin Haig » Tue Feb 25, 2014 2: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
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: xBrowse Cell Lost Focus

Postby James Bott » Tue Feb 25, 2014 3:40 pm

Colin,

What was the actual error?

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

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: xBrowse Cell Lost Focus

Postby cnavarro » Tue Feb 25, 2014 6: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
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: xBrowse Cell Lost Focus

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 65 guests