XBROWSE bitmaps from resource

Post Reply
User avatar
don lowenstein
Posts: 196
Joined: Mon Oct 17, 2005 9:09 pm
Contact:

XBROWSE bitmaps from resource

Post 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.
Don Lowenstein
www.laapc.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: XBROWSE bitmaps from resource

Post by Antonio Linares »

Don,

Try this:

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

Antonio Linares
www.fivetechsoft.com
User avatar
FranciscoA
Posts: 1964
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: XBROWSE bitmaps from resource

Post 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.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh1204-MySql-TMySql
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: XBROWSE bitmaps from resource

Post 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" } )
Regards

G. N. Rao.
Hyderabad, India
User avatar
FranciscoA
Posts: 1964
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: XBROWSE bitmaps from resource

Post by FranciscoA »

Rao,
Yes, I changed my code.
Thanks.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh1204-MySql-TMySql
Post Reply