Code: Select all | Expand
// C:\FWH...\SAMPLES\DETLEF4.PRG
#Include "FiveWin.ch"
#Define PAD_LEFT 0
#Define PAD_RIGHT 1
#Define PAD_CENTER 2
FUNCTION Main()
LOCAL oBrushRed, oBrushGrn
LOCAL oPrn, nWidth, nHeight, nRow
LOCAL oFont, oBold, cTxt
LOCAL cBigText := MemoRead( "tutor02.prg" )
DEFINE BRUSH oBrushRed COLOR CLR_RED
DEFINE BRUSH oBrushGrn COLOR CLR_HGREEN
// Before print command
TPrinter():lUseHaruPdf := .T.
TPreview():bButtonBar := {| oPrv, oWnd | MyBar( oPrv, oWnd ) }
PRINT oPrn PREVIEW MODAL
DEFINE FONT oFont NAME "CONSOLAS" SIZE 0, - 10 OF oPrn
DEFINE FONT oBold NAME "VERDANA" SIZE 0, - 26 BOLD OF oPrn
oPrn:SetPage( 9 ) ; oPrn:SetPortrait()
nWidth := oPrn:PageWidth( "CM" )
nHeight := oPrn:PageHeight( "CM" )
PAGE
oPrn:Say( 2, nWidth / 2, FWVERSION + " oPrn:Say()", oBold, NIL, NIL, NIL, 2, "CM" )
oPrn:SayText( 1000, 400, "DETLEF: THE BIG TEXT IN FWH: ", 4200, 400, oBold, nil, CLR_MAGENTA, nil, "PIXEL" )
oPrn:SayText( 1300, 400, cBigText, 4200, 4000, oFont, nil, CLR_YELLOW, oBrushRed, "PIXEL" )
oPrn:SayText( 5700, 400, "Yellow, RedBrush DETLEF", 4200, 400, oBold, nil, CLR_YELLOW, oBrushRed, "PIXEL" )
oPrn:SayText( 6200, 400, "Default: nil,nil DETLEF", 4200, 400, oBold, nil, nil, oBrushGrn, "PIXEL" )
cTxt := "kapiabafwh@gmail.com"
oPrn:Say( 6700, 1800, cTxt, oBold, , CLR_HRED, , PAD_CENTER )
ENDPAGE
ENDPRINT
TPreview():bButtonBar := nil
RELEASE FONT oFont, oBold, oBrushRed, oBrushGrn
RETURN NIL
STATIC FUNCTION MyBar( Self, oWnd )
LOCAL cFile := "mytest.pdf", oFont, oBtn
LOCAL nAlpha := 0x60
LOCAL nBarClr := RGB( 0, 0x2E, 0x5C )
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE BUTTONBAR ::oBar OF oWnd SIZE 48, 48 2007
::oBar:SetColor( { |l,o| If( l, CLR_BLACK, CLR_WHITE ) }, oWnd:nClrPane )
::oBar:bClrGrad := { |lInvert| If( lInvert, nArgb( 96, CLR_WHITE ), nArgb( nAlpha % 256, nBarClr ) ) }
::oBar:GoTop()
DEFINE BUTTON OF ::oBar RESOURCE FWBitmap( "PDF" ) CENTER ;
ACTION ::SaveAs( .T., cFile, .T. )
DEFINE BUTTON OF ::oBar RESOURCE FWBitmap( "email" ) CENTER ;
ACTION ::SendEmail()
// By master: UWE. ( Ukoenig )
DEFINE BUTTON oBtn OF ::oBar PROMPT "Color" FILE "..\bitmaps\colors.bmp" ;
ACTION ( nBarClr := ChooseColor( RGB( 0, 0x2E, 0x5C ) ), ::oBar:Refresh() )
DEFINE BUTTON OF ::oBar RESOURCE FWBitmap( "Exit2" ) CENTER ;
ACTION oWnd:End()
RETURN NIL
// FIN / END - kapiabafwh@gmail.com
Regards, saludos.