to understand well I explain you
in a program I run this function
Code: Select all
oGraficos:Rectang( nLinea+nVertic+4, nColumnaInicio+nHoriz, nLinea+nVertic+10, nColumnaFinal+nHoriz ,oPen5,dati->(Recno()) )
oGraficos is a object of a class
and into class there is this method :
Code: Select all
METHOD Rectang( nTop, nLeft, nBottom, nRight, oPen ,nRecord) CLASS XXXXXX
local hPen := if( oPen = nil, 0, oPen:hPen )
Local nX := oPen:nWidth / 2
IIF( nRecord == nil , nRecord := 0 , )
::GetDC()
*Rectangle( ::hDC, nTop, nLeft, nBottom, nRight, hPen )
MoveTo( ::hDC, nLeft, nTop )
LineTo( ::hDC, nRight, nBottom, hPen )
PPP
::ReleaseDC()
if nRecord > 0
aadd(::aItems,{nTop-nX,nLeft-nX,nBottom+nX,nRight+nX,nRecord})
endif
return nil
But it create a line as a pen and I want to show a rectangule filled of the color hpen
where I insert the word "PPP" i must insert the _fillrect method but it want a brush
Code: Select all
METHOD _FillRect( nTop, nLeft, nBottom, nRight, nColor ) CLASS XXXX
LOCAL oBrush, hBru, hOld
hBru := CreateSolidBrush( nColor )
hPen := CreatePen( nColor )
hOld := SelectObject( ::hDC, hBru )
MoveTo( ::hDC, nLeft, nTop )
LineTo( ::hDC, nRight, nBottom, hPen )
FillRect( ::hDC, { nTop, nLeft, nBottom, nRight }, hBru )
SelectObject( ::hDC, hOld )
DeleteObject( hBru )
RETURN (Nil)
I hope you understand now well my work
Regards