Page 1 of 1

Question about xBrowse

Posted: Sun Aug 20, 2023 8:40 pm
by Armando
kindly friends:

With the code below I know the current value of the cell

Code: Select all | Expand

:bOnChange  := { |oCol, uOldVal| VerSaldo(uOldVal) }
 
Now how do I know the new value after editing the cell?

I must compare the old content against the new content
and I must know if the new content is empty

With best regards

Re: Question about xBrowse

Posted: Mon Aug 21, 2023 3:32 am
by nageswaragunupudi
Now how do I know the new value after editing the cell?

Code: Select all | Expand

oCol:Value
Notes:
Do not use this for validation. This is called when the modified data is already written and also if the old data is different from the new data written.
This codeblock is meant for taking consequential action after modification of data in the cell but not for validation.

Re: Question about xBrowse

Posted: Mon Aug 21, 2023 3:49 am
by Armando
Mr. Rao:

Thanks so much, I understood.

By the way, is it possible to paste what I have on the clipboard into a cell with just one mouse click?

Best regards

Re: Question about xBrowse

Posted: Mon Aug 21, 2023 7:20 am
by Marc Venken

Code: Select all | Expand

    

 oBrwmail:bRClicked := { || placemail() }

function placemail
    cText = oClp:getText()  //  This is content of clipboard
    testmail->(dbappend())
    testmail->email = cText
    obrwmail:refresh()
return
You can also use the varput and do it in Xbrowse itself

Re: Question about xBrowse

Posted: Mon Aug 21, 2023 10:22 am
by nageswaragunupudi
Marc Venken wrote:

Code: Select all | Expand

    

 oBrwmail:bRClicked := { || placemail() }

function placemail
    cText = oClp:getText()  //  This is content of clipboard
    testmail->(dbappend())
    testmail->email = cText
    obrwmail:refresh()
return
You can also use the varput and do it in Xbrowse itself
Dear Friend.
With FWH you do not have to write long code like this at all.

Re: Question about xBrowse

Posted: Mon Aug 21, 2023 10:25 am
by nageswaragunupudi
By the way, is it possible to paste what I have on the clipboard into a cell with just one mouse click?
Yes.
Just by clicking Ctrl-V.

For this we first need to set

Code: Select all | Expand

oBrw:lCanPaste := .t.
We can paste text into text fields and even images into Image fields.
All by just one click Ctrl-V.

Code: Select all | Expand

function XbrPaste()

   local aData := { { "olga     ", MEMOREAD( "c:\fwh\bitmaps\olga1.jpg" ) }, ;
                    { "Two      ", "" }, { "Three      ", "" } }

   XBROWSER aData FASTEDIT SETUP ( ;
      oBrw:lCanPaste    := .t., ;
      oBrw:nRowHeight   := 100, ;
      oBrw:aCols[ 2 ]:cDataType:= "P" )

return nil
Image

Re: Question about xBrowse

Posted: Mon Aug 21, 2023 4:31 pm
by Armando
Mr. Rao:

Thanks a lot.

Regards