#include 'fivewin.ch'
#include 'xbrowse.ch'
function Main()
local oDlg, oBrw, oFont
local nRecSel
USE CUSTOMER ALIAS CUST
nRecSel := CUST->( RecNo() )
DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -14
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' BACKGROUND ""
WITH OBJECT oBrw
:bChange := { || nRecSel := oBrw:BookMark }
:nRowDividerStyle := LINESTYLE_NOLINES
:nColDividerStyle := LINESTYLE_NOLINES
:nMarqueeStyle := MARQSTYLE_HIGHLROW
END
WITH OBJECT oBrw:aCols[8]
:AddBmpFile(".\tipo\print.bmp")
:AddBmpFile(".\tipo\laptop.bmp")
:cHeader := "Married"
:bBmpData := { || iif( _FIELD->Married, 1, 2) }
END
WITH OBJECT oBrw:aCols[4]
:AddBmpFile(".\tipo\AULE.bmp")
:bBmpData := { || 1 }
:bStrData := { || _FIELD->City}
END
AEval( oBrw:aCols, { |oCol| ;
oCol:bPaintText := { |oCol, hDC, cData, aRect | ;
PaintCol( oCol, hDC, cData, aRect, nRecSel ) } ;
} )
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED
CLOSE CUST
RELEASE FONT oFont
return nil
static function PaintCol( oCol, hDC, cData, aRect, nRecSel )
if nRecSel == CUST->( RecNo() )
GradientFill( hDC, aRect[ 1 ] - 2, aRect[ 2 ] - 3, aRect[ 3 ] + 1, aRect[ 4 ] + 5,;
{ { 1, RGB( 220, 235, 252 ), RGB( 193, 219, 252 ) } }, .T. )
SetBkMode( hDC, 1 )
RoundBox( hDC, 2, aRect[ 1 ] - 1, WndWidth( oCol:oBrw:hWnd ) - 22, aRect[ 3 ] + 1, 2, 2,;
RGB( 235, 244, 253 ), 1 )
RoundBox( hDC, 1, aRect[ 1 ] - 2, WndWidth( oCol:oBrw:hWnd ) - 21, aRect[ 3 ] + 2, 2, 2,;
RGB( 125, 162, 206 ), 1 )
endif
SetTextColor( hDC, 0 )
DrawTextEx( hDC, cData, aRect, oCol:nDataStyle )
return nil
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
HB_FUNC( ROUNDBOX )
{
HDC hDC = ( HDC ) hb_parni( 1 );
HBRUSH hBrush = ( HBRUSH ) GetStockObject( 5 );
HBRUSH hOldBrush = ( HBRUSH ) SelectObject( hDC, hBrush );
HPEN hPen, hOldPen ;
if( hb_pcount() > 8 )
hPen = CreatePen( PS_SOLID, hb_parnl( 9 ), ( COLORREF ) hb_parnl( 8 ) );
else
hPen = CreatePen( PS_SOLID, 1, ( COLORREF ) hb_parnl( 8 ) );
hOldPen = ( HPEN ) SelectObject( hDC, hPen );
hb_retl( RoundRect( hDC ,
hb_parni( 2 ),
hb_parni( 3 ),
hb_parni( 4 ),
hb_parni( 5 ),
hb_parni( 6 ),
hb_parni( 7 ) ) );
SelectObject( hDC, hOldBrush );
DeleteObject( hBrush );
SelectObject( hDC, hOldPen );
DeleteObject( hPen );
}
#pragma ENDDUMP
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot], Marc Venken and 64 guests