How to change image on edit_button in xBrowse

How to change image on edit_button in xBrowse

Postby mtajkov » Tue Jun 25, 2024 6:08 pm

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 view  RUN


       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 view  RUN


       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.
Best regards
Milos

[ FWH 21.11 ] [ xHarbour 1.2.3 Intl. (SimpLex) (Build 20150603) ]
mtajkov
 
Posts: 130
Joined: Sun Mar 08, 2009 4:33 pm

Re: How to change image on edit_button in xBrowse

Postby FranciscoA » Tue Jun 25, 2024 8:43 pm

Hi, try this way:
Code: Select all  Expand view  RUN
oCol:bBmpData  := { || iif( !empty(RptSpsFak->Prilog1) ,1,2)}
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2159
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: How to change image on edit_button in xBrowse

Postby mtajkov » Wed Jun 26, 2024 4:35 am

Thank you Francisco,

but if i use:
Code: Select all  Expand view  RUN
oCol:bBmpData  := { || iif( !empty(RptSpsFak->Prilog1) ,1,2)}
 

I get it:
Image

I would like this:

Image
Best regards
Milos

[ FWH 21.11 ] [ xHarbour 1.2.3 Intl. (SimpLex) (Build 20150603) ]
mtajkov
 
Posts: 130
Joined: Sun Mar 08, 2009 4:33 pm

Re: How to change image on edit_button in xBrowse

Postby cmsoft » Wed Jun 26, 2024 1:26 pm

Puedes hacer
Code: Select all  Expand view  RUN

oCol::oBtnElip:LoadBitmaps("on")
oCol::oBtnElip:SetText("")
 
User avatar
cmsoft
 
Posts: 1291
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: How to change image on edit_button in xBrowse

Postby mtajkov » Sun Jun 30, 2024 6:11 am

Thank you
Best regards
Milos

[ FWH 21.11 ] [ xHarbour 1.2.3 Intl. (SimpLex) (Build 20150603) ]
mtajkov
 
Posts: 130
Joined: Sun Mar 08, 2009 4:33 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 44 guests