- Code: Select all Expand view
function TestMain()
local oWnd
local oBrw
local nI
local aArray := {}
DEFINE WINDOW oWnd TITLE "Testing Transparent Button-Cell"
if empty( aArray )
aArray := {{"one","two","three","four"},;
{"one","two","three","four"},;
{"one","two","three","four"},;
{"one","two","three","four"}}
endif
@ 0,0 XBROWSE oBrw OF oWnd ;
COLUMNS {1,2,3,4} ;
HEADERS {"Btn Trans - 1","Btn Trans - 2","Header - 3","Header - 4"} ;
array aArray LINES CELL fastedit
oBrw:nRowHeight := 25
oBrw:bClrStd := {|| {CLR_BLACK, CLR_CYAN } }
oBrw:aCols[ 1 ]:addbmpfile( "..\bitmaps\16x16\adddbf.bmp" )
oBrw:aCols[ 1 ]:lBtnTransparent := .t.
oBrw:aCols[ 1 ]:nBtnBmp := 1
oBrw:aCols[ 2 ]:addbmpfile( "..\bitmaps\16x16\zoom2.bmp" )
oBrw:aCols[ 2 ]:lBtnTransparent := .t.
oBrw:aCols[ 2 ]:nBtnBmp := 1
oBrw:aCols[ 3 ]:addbmpfile( "..\bitmaps\16x16\adddbf.bmp" )
oBrw:aCols[ 3 ]:nBtnBmp := 1
oBrw:aCols[ 4 ]:addbmpfile( "..\bitmaps\alphabmp\apple.bmp" ) // cambiado para imagen alpha
oBrw:aCols[ 4 ]:nBtnBmp := 1
aeval( oBrw:aCols, { |oCols| oCols:nEditType := EDIT_BUTTON } )
// oBrw:nMarqueeStyle :=MARQSTYLE_HIGHLWIN7 // MARQSTYLE_HIGHLROW
oWnd:oClient := oBrw
oBrw:createfromcode()
activate window oWnd
return nil
se puede resolver :
- Code: Select all Expand view
METHOD ChangeBitmap( ) CLASS TXBrwColumn // BtnGet
if ::nBtnBmp > 0 .and. len( ::aBitmaps ) >= ::nBtnBmp
::oBtnElip:hBitmap1 := ::aBitMaps[::nBtnBmp, BITMAP_HANDLE ]
::oBtnElip:HasAlpha( ::oBtnElip:hBitmap1, 1 ) // añadido para alpha
::oBtnList:hBitmap1 := ::aBitMaps[::nBtnBmp, BITMAP_HANDLE ]
::oBtnElip:cCaption := ""
else
::oBtnElip:hBitmap1 := 0
::oBtnList:hBitmap1 := 0
::oBtnElip:cCaption := "..."
endif
if ::oBrw:lAdjusted // 2014-10-08 to avoid calling refresh() prematurely
::oBrw:refresh()
endif
return nil