Page 1 of 1

xbrowse bitmap from resource

Posted: Sun Feb 14, 2021 8:36 am
by damianodec
hi,
inside my .res file there are Bitmaps "RED" and "GREEN" (a little ball) and I link .res when compile.

how can I show bmp inside my XBROWSE after EMAIL column depending on EMAIL value (in EMAIL there is 1 for green or 2 for red numeric value) ?:

Code: Select all

local oColB
DEFINE IMAGE oBmp RESOURCE "RED"
...
    @ 40,10 XBROWSE oBrw SIZE -10,-50 PIXEL ;
            ALIAS "CNTINS" ;
      COLUMNS "TPLET", "EMAIL"  ;
      HEADERS "Let.","Mail" ;
      PICTURE nil, nil ;             
      OF oDlg2
         oBrw:CreateFromCode()
 
thank you

Re: xbrowse bitmap from resource

Posted: Sun Feb 14, 2021 10:15 am
by leandro
Parte del código ejemplo en testxbrw.prg

Code: Select all

   oCol := oBrw:AddCol()
   oCol:AddResource("GREEN")
   oCol:AddResource("RED")
   oCol:cHeader  := "Married"
   oCol:bBmpData   := { || iif( _FIELD->Married, 1, 2) }
   oCol:bStrData   := { || iif( _FIELD->Married, "Yes", "No ")}
   oCol:bEditValue := { || _FIELD->Married }
   oCol:nDataStyle := oCol:DefStyle( AL_RIGHT, .T.)
   oCol:nEditType := EDIT_LISTBOX
   oCol:aEditListTxt   := { "Yes", "No"}
   oCol:aEditListBound := { .t., .f. }
   oCol:bOnPostEdit := {|o, v| (DBRLOCK(), _FIELD->Married := v, DBUNLOCK() ) }
 

Re: xbrowse bitmap from resource

Posted: Mon Feb 15, 2021 7:15 am
by damianodec
thank you Leandro