#include 'fivewin.ch'
#include 'xbrowse.ch'
function Main()
local oDlg, oBrw, oFont
USE \FWH\SAMPLES\CUSTOMER ALIAS CUST
DEFINE FONT oFont NAME 'Tahoma' SIZE 0,-12
DEFINE DIALOG oDlg SIZE 640,440 PIXEL ;
FONT oFont TITLE 'XBrowse Gradient Rows'
@ 10,10 XBROWSE oBrw OF oDlg ;
SIZE 300,200 PIXEL ;
AUTOCOLS ALIAS 'CUST' LINES NOBORDER
WITH OBJECT oBrw
:nMarqueeStyle := 4
:bClrRowFocus := { || { CLR_BLACK, RGB( 0, 251, 220 ) } }
END
AEval( oBrw:aCols, { |oCol| ;
oCol:bClrSelFocus := { || { CLR_BLACK, RGB( 255, 224, 126) } }, ;
oCol:bPaintText := { |oCol, hDC, cData, aRect, aColors| ;
PaintCol( oCol, hDC, cData, aRect, aColors ) } ;
} )
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED
CLOSE CUST
RELEASE FONT oFont
return nil
static function PaintCol( oCol, hDC, cData, aRect, aColors )
local aGrad
if aColors[ 2 ] == RGB( 255, 224, 126 )
aGrad := { { .5, RGB( 255, 224, 126 ), RGB( 255, 255, 193 ) }, ;
{ .5, RGB( 255, 255, 193 ), RGB( 255, 224, 126 ) } }
elseif aColors[ 2 ] == RGB( 0, 251, 220 )
aGrad := { { .5, RGB( 0, 251, 220 ), RGB( 221, 255, 251 ) }, ;
{ .5, RGB( 221, 255, 251 ), RGB( 0, 251, 220 ) } }
endif
if aGrad != nil
GradientFill( hDC, aRect[ 1 ], aRect[ 2 ], aRect[ 3 ] - 1, aRect[ 4 ], aGrad, .t.)
SetBkMode( hDC, 1 )
endif
DrawTextEx( hDC, cData, aRect, oCol:nDataStyle )
return nil