Page 1 of 1

XBROWSE bitmaps from resource

Posted: Tue Mar 19, 2013 8:34 pm
by don lowenstein
what's the best way to put a bitmap from a resource file on an xbrowse column?

I can't seem to find this exact example.

Re: XBROWSE bitmaps from resource

Posted: Tue Mar 19, 2013 9:31 pm
by Antonio Linares
Don,

Try this:

oCol:AddResource( "resname" )
oCol:bBmpData := { || 1 }
oCol:bStrData := { || nil }

Re: XBROWSE bitmaps from resource

Posted: Wed Mar 20, 2013 12:17 am
by FranciscoA
Hi, here other way:

Code: Select all

 oLbx:aCols[1]:nHeadStrAlign := 2   //texto centrado
  oLbx:aCols[1]:nDataStrAlign := 2   //texto centrado
  oLbx:aCols[1]:cHeader:="Mesa"
  oLbx:aCols[1]:AddResource( "Document_24" )
  oLbx:aCols[1]:AddResource( "Emo_Alegre" )
  oLbx:aCols[1]:bBmpData := {|| if(oLbx:nArrayAt=1, 2,1) }
  oLbx:aCols[1]:lBmpStretch     := .t.
  oLbx:aCols[1]:lBmpTransparent := .T.
  oLbx:aCols[1]:nDataBmpAlign   := AL_LEFT
  oLbx:aCols[1]:nWidth := 60
 
Regards.

Re: XBROWSE bitmaps from resource

Posted: Wed Mar 20, 2013 8:08 am
by nageswaragunupudi
Since version 10.08, we can use

oCol:AddBitmap( cResourceOrBmpFileName )
or
oCol:AddBitmap( aArrayOfResourcesOrBmpFileNames )

in a single call,
instead of calling oCol:AddResource( cRes ) and oCol:AddBmpFile( cBmpFile ) multiple times.

---
oLbx:aCols[1]:AddResource( "Document_24" )
oLbx:aCols[1]:AddResource( "Emo_Alegre" )
---
can be written as

oLbx:aCols[1]:AddBitmap( { "Document_24", "Emo_Alegre" } )

Re: XBROWSE bitmaps from resource

Posted: Wed Mar 20, 2013 2:10 pm
by FranciscoA
Rao,
Yes, I changed my code.
Thanks.