- Code: Select all Expand view
#include 'fivewin.ch'
#include 'xbrowse.ch'
function Main()
local oDlg, oBrw, oFont
local aRowGrad, aSelGrad, aStdGrad
local oCol
local n := RGB( 157, 248, 255 )
XbrNumFormat( 'E', .t. )
aRowGrad := { { .5, RGB( 232, 241, 252 ), RGB( 232, 241, 252 ) }, ;
{ .5, RGB( 210, 225, 244 ), RGB( 235, 243, 253 ) } }
aSelGrad := { { .5, RGB( 255, 255, 251 ), RGB( 255, 237, 178 ) }, ;
{ .5, RGB( 255, 218, 103 ), RGB( 255, 233, 162 ) } }
USE CUSTOMER ALIAS CUST
DEFINE FONT oFont NAME 'Tahoma' SIZE 0,-14
DEFINE DIALOG oDlg SIZE 640,440 PIXEL ;
FONT oFont TITLE 'XBrowse Gradient Rows FWH 9.12'
@ 10,10 XBROWSE oBrw OF oDlg ;
SIZE -10,-10 PIXEL ;
COLUMNS 'FIRST', 'HIREDATE', 'MARRIED', 'SALARY' ;
ALIAS 'CUST' LINES NOBORDER
oBrw:Married:SetCheck() // Default FWH Bitmap is Alpha
WITH OBJECT oBrw:First
:AddBitmap( '\fwh\bitmaps\open2.bmp' ) // non-alpha bitmap
:bBmpData := { || 1 }
END
WITH OBJECT oBrw:HireDate
:AddBitmap( '\fwh\bitmaps\Alphabmp\task.bmp' ) // alpha
:bBmpData := { || 1 }
END
WITH OBJECT oBrw
:nStretchCol := 1
:nMarqueeStyle := 4
:bClrSelFocus := { || { CLR_BLACK, aSelGrad } }
:bClrRowFocus := { || { CLR_BLACK, aRowGrad } }
END
// añadido un boton ....
oCol := oBrw:AddCol()
WITH OBJECT oCol
:cHeader := ""
:bStrData := { || " " }
:nEditType := EDIT_BUTTON
:AddBitmap( '\fwh\bitmaps\Alphabmp\task.bmp' )
:lBtnTransparent := .t.
:nBtnBmp := 1
:bEditBlock := { || msginfo(1) }
:bOnPostEdit := {|| .t. }
:bLDClickData:={ || .t. }
:nBtnWidth:= 24
END
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED
CLOSE CUST
RELEASE FONT oFont
return nil
Una posible solucion :
- Code: Select all Expand view
CLASS MyXbrCol FROM TXBrwColumn
.......
DATA bClrBtn
......
::bClrBtn := ::bClrHeader
.....
METHOD PaintCell( )
.....
::oBtnElip:Move( nButtonRow, nButtonCol, nBtnWidth + 1, nHeight, .f.) // ButtonGet
::oBtnElip:Show()
::oBtnElip:GetDC()
if ::lBtnTransparent
aColors:= Eval( ::bClrBtn ,.f. ) // nuevo ....
::oBtnElip:SetColor( aColors[ 1 ],aColors[ 2 ] )
else
FillRect( hDC, {nButtonRow, nButtonCol, nButtonRow + nHeight , nButtonCol + nBtnWidth + 1 },; // ButtonGet
::oBtnElip:oBrush:hBrush )
endif