Page 1 of 1

How to change image on edit_button in xBrowse

Posted: Tue Jun 25, 2024 6:08 pm
by mtajkov
Depending on the column value in the DBF file I want to change the image on the EDIT_BUTTON

this is the current code:

Code: Select all | Expand


       oCol := oBrwZbr:AddCol()
       oCol:nBtnBmp := 1
       oCol:AddResource("PDF")
       oCol:nWidth    := 36
       oCol:oDataFont     := oFontBrw
       oCol:nEditType     := EDIT_BUTTON
       oCol:bEditBlock    := { | nRow, nCol, oCol, nKey | DownLoadXml(rtrim(RptSpsFak->Eid),"1") }
   
 
I tried:

Code: Select all | Expand


       oCol := oBrwZbr:AddCol()
       oCol:nBmpData  := { || iif( !empty(RptSpsFak->Prilog1) ,1,2)} 
       oCol:AddResource("PDF")
        oCol:AddResource("OFF")
       oCol:nWidth    := 36
       oCol:oDataFont     := oFontBrw
       oCol:nEditType     := EDIT_BUTTON
       oCol:bEditBlock    := { | nRow, nCol, oCol, nKey | DownLoadXml(rtrim(RptSpsFak->Eid),"1") }
 

 
but oCol:nBmpData does not allow that possibility.

I would also like to be able to dynamically change the nEditType.

Re: How to change image on edit_button in xBrowse

Posted: Tue Jun 25, 2024 8:43 pm
by FranciscoA
Hi, try this way:

Code: Select all | Expand

oCol:bBmpData  := { || iif( !empty(RptSpsFak->Prilog1) ,1,2)}

Re: How to change image on edit_button in xBrowse

Posted: Wed Jun 26, 2024 4:35 am
by mtajkov
Thank you Francisco,

but if i use:

Code: Select all | Expand

oCol:bBmpData  := { || iif( !empty(RptSpsFak->Prilog1) ,1,2)}
 
I get it:
Image

I would like this:

Image

Re: How to change image on edit_button in xBrowse

Posted: Wed Jun 26, 2024 1:26 pm
by cmsoft
Puedes hacer

Code: Select all | Expand

oCol::oBtnElip:LoadBitmaps("on")
oCol::oBtnElip:SetText("")
 

Re: How to change image on edit_button in xBrowse

Posted: Sun Jun 30, 2024 6:11 am
by mtajkov
Thank you