vilian wrote:Mr Rao,
My previous version is FWH1905, may be it is the reason i have different results.
Thanks, I will check and get back.
vilian wrote:Mr Rao,
My previous version is FWH1905, may be it is the reason i have different results.
Euclides wrote:Hi! Sorry for jumping in...
With FWH 18.01 the printing works as Vilian expects.
Regrds, Euclides
METHOD Line( nTop, nLeft, nBottom, nRight, oPen )
METHOD Box( nRow, nCol, nBottom, nRight, oPen )
METHOD RoundBox( nRow, nCol, nBottom, nRight, nWidth, nHeight, oPen, nBGColor )
#include "fivewin.ch"
function Main()
local oPrn, oPen
local nTop, nLeft, nRight
nLeft := 200
nRight := 3000
PRINT oPrn PREVIEW
DEFINE PEN oPen WIDTH 5 COLOR CLR_BLACK OF oPrn
PAGE
oPrn:Say( 300, nLeft, FWVERSION )
oPrn:Line( nTop := 500, nLeft, nTop + 300, nRight, oPen )
oPrn:Box( nTop += 400, nLeft, nTop + 300, nRight, oPen )
oPrn:RoundBox( nTop += 400, nLeft, nTop + 300, nRight, 200, 200, oPen )
ENDPAGE
ENDPRINT
return nil
- Method RoundBox() was not working correctly. Fixed and enhanced. Methods
Box and Ellipse are also enhanced.
METHOD Box( nTop, nLeft, nBottom, nRight, [uPen], [uBrush], [aText], ;
[cUnits] )
METHOD RoundBox( nRow, nCol, nBottom, nRight, nWidth, nHeight, [uPen], ;
[uBrush], [aText], [cUnits] )
METHOD Ellipse( nTop, nLeft, nBottom, nRight, [uPen], [uBrush], [aText], ;
[cUnits] )
METHOD FillRect( aRect, uBrush, [cUnits] )
IF lDrawBox
oPrn:RoundBox(aPos[2],aPos[1],aPos[2]+aTam[1],aPos[1]+aTam[2],20,20,oPenSolid,If(lFill,CLR_HGRAY,NIL))
ENDIF
IF lDrawBox
#if FW_VersionNo > 19060
oPrn:RoundBox(aPos[1],aPos[2],aPos[1]+aTam[2],aPos[2]+aTam[1],20,20,oPenSolid,If(lFill,CLR_HGRAY,NIL))
#else
oPrn:RoundBox(aPos[2],aPos[1],aPos[2]+aTam[1],aPos[1]+aTam[2],20,20,oPenSolid,If(lFill,CLR_HGRAY,NIL))
#endif
ENDIF
oPrn:RoundBox( 1.0, 1.0, 2.0, 7.5, 0.4, 0.4, oPen, CLR_YELLOW, ;
{ "HORIZONTAL" + CRLF + FWVERSION, { oFont, oFontS }, CLR_HRED }, "INCHES" )
#include "fivewin.ch"
function Main()
local oPrn, oPen, oPen2, oFont, oFontV, oFontS, oFont14V, oBrush
local cSyntax := "Syntax :" + CRLF + ;
"RoundBox( nTop, nLeft, nBottom, nRight, nRndW, nRndH, oPen, onBack, aText, cUnits )"
local cText := "aText :" + CRLF + "{ cText, oFont, nClrText, [cAlign] }"
DEFINE BRUSH oBrush FILE "c:\fwh\bitmaps\backgrnd\browback.bmp"
PRINT oPrn PREVIEW
DEFINE PEN oPen WIDTH 3 COLOR CLR_HRED OF oPrn
DEFINE PEN oPen2 WIDTH 1 COLOR CLR_BLACK OF oPrn
DEFINE FONT oFontS NAME "ARIAL" SIZE 0,-12 OF oPrn
DEFINE FONT oFont NAME "ARIAL" SIZE 0,-20 OF oPrn
DEFINE FONT oFontV NAME "ARIAL" SIZE 0,-20 BOLD NESCAPEMENT 900 OF oPrn
DEFINE FONT oFont14V NAME "ARIAL" SIZE 0,-14 NESCAPEMENT 900 OF oPrn
PAGE
oPrn:RoundBox( 1.0, 1.0, 2.0, 7.5, 0.4, 0.4, oPen, CLR_YELLOW, ;
{ "HORIZONTAL" + CRLF + FWVERSION, { oFont, oFontS }, CLR_HRED }, "INCHES" )
oPrn:RoundBox( 2.2, 1.0, 4.2, 2.0, 0.2, 0.2, oPen, CLR_GRAY, ;
{ "VERTICAL" + CRLF + "TEXT", oFontV, CLR_YELLOW }, "INCHES" )
oPrn:RoundBox( 5.9, 1.5, 7.1, 2.1, 0.1, 0.1, oPen2, CLR_HGRAY, ;
{ "Faturas", oFont14V, CLR_BLACK }, "INCHES" )
oPrn:RoundBox( 7.1, 1.5, 8.3, 2.1, 0.1, 0.1, oPen2, CLR_HGRAY, ;
{ "Cálculo" + CRLF + "Imposto", oFont14V, CLR_BLACK }, "INCHES" )
oPrn:RoundBox( 8.3, 1.5, 10.2, 2.1, 0.1, 0.1, oPen2, CLR_HGRAY, ;
{ "Transportador", oFont14V, CLR_BLACK }, "INCHES" )
oPrn:RoundBox( 2.2, 3.0, 4.2, 7.5, 0.3, 0.3, oPen, oBrush, ;
{ cSyntax, oFont, CLR_BLACK }, "INCHES" )
oPrn:RoundBox( 4.4, 3.0, 5.9, 7.5, 0.3, 0.3, oPen, CLR_WHITE, ;
{ cText, oFont, CLR_BLACK }, "INCHES" )
ENDPAGE
ENDPRINT
return nil
vilian wrote:Mr Rao,
Thank you for the great explanation about RoundBox() and other functions. For sure i will apply this in my code and improve it.
However, there is one problem yet. IF you try my example in both versions(1905/2104) you could see that the lines are stronger in the new version. I think it's happening as result of some change in TPEN class. Could you fix it too ?
oPrn:RoundBox(aPos[1],aPos[2],aPos[1]+aTam[2],aPos[2]+aTam[1],20,20,::oPenSolid,,{cTexto,oFont,CLR_BLACK,cPadTexto})
But, the cTexto is printed using the last font used in the report, not with oFont that I passed. Do you know why ?
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: asesormix and 74 guests