"Mi cadena " + Chr( 88 ) + " Resto de cadena"
// \SAMPLES\TESTPRN.PRG
// Printing a whole window sample
// You may use also :hardCopy() method without creating a PRINT object
#include "FiveWin.ch"
#define PAD_LEFT 0
#define PAD_RIGHT 1
#define PAD_CENTER 2
static oWnd
MEMVAR nCopias
FUNCTION Main()
nCopias := 1 // ponga en el dialogo Number of copies.
DEFINE WINDOW oWnd FROM 1, 1 TO 20, 60 TITLE "Printing a Window"
@ 3, 3 BUTTON "&Print me" OF oWnd SIZE 80, 20 ;
ACTION PrintMe_Copias() // try also with oWnd:HardCopy()
ACTIVATE WINDOW oWnd
RETURN NIL
FUNCTION PrintMe_Copias()
LOCAL nI
FOR nI := 1 TO nCopias
SYSREFRESH()
PrintMe()
NEXT
RETURN NIL
FUNCTION PrintMe()
LOCAL oPrn, oFont, oPen, aPrn
LOCAL nLinI, nColI, nLinF, nColF
aPrn := GetPrinters()
IF Empty( aPrn ) // Empty( oPrn:hDC )
MsgStop ("No se encontró impresora", "No se encontró impresora")
RETURN NIL
ENDIF
PRINTER oPrn PREVIEW MODAL // PARA TESTAR A IMPRESSORA ANTES DE IMPRIMIR
IF EMPTY( oPrn:hDC )
MsgInfo ("HABÍA ALGO MAL CON LA IMPRESORA", "ENCIENDA LA IMPRESORA")
oPrn:End()
RETURN( .F. )
ENDIF
oPrn:End()
// PRINT oPrn NAME "Impresión en Vertical.." PREVIEW
PRINT oPrn PREVIEW
DEFINE FONT oFont NAME "Arial" SIZE 0, -10 BOLD OF oPrn
DEFINE PEN oPen WIDTH 2 OF oPrn
oPrn:SetPage(9) // A4
oPrn:SetPortrait() // Vertical
PAGE
nLinI := 0.90
nColI := 0.90
nLinF := 28.6
nColF := 20.0
oPrn:Cmtr2Pix(@nLinI, @nColI)
oPrn:cmtr2Pix(@nLinF, @nColF)
oPrn:Box(nLinI, nColI, nLinF, nColF, oPen )
oPrn:cmSay( 1.0, 1.0, "Superior Izquierda", oFont,,CLR_BLACK,,PAD_LEFT )
oPrn:cmSay( 1.0, 10.5, "Superior Centro", oFont,,CLR_BLACK,,PAD_CENTER )
oPrn:cmSay( 1.0, 20.0, "Superior Derecha", oFont,,CLR_BLACK,,PAD_RIGHT )
// Simples:
oPrn:cmSay( 5.0, 10.0, Replicate( OemToAnsi( "Í" ), 90 ), oFont,,CLR_BLACK,,PAD_CENTER )
// .OR.
oPrn:cmSay( 5.5, 10.0, Replicate( OemToAnsi( CHR(205) ), 90 ), oFont,,CLR_BLACK,,PAD_CENTER )
oPrn:cmSay(28.0, 1.0, "Inferior Izquierda", oFont,,CLR_BLACK,,PAD_LEFT )
oPrn:cmSay(28.0, 10.5, "Inferior Centro", oFont,,CLR_BLACK,,PAD_CENTER )
oPrn:cmSay(28.0, 20.0, "Inferior Derecha", oFont,,CLR_BLACK,,PAD_RIGHT )
ENDPAGE
ENDPRINT
// FWSavePreviewToPDF( oPrn, "Cartellino.pdf", .F. )
RETURN NIL
oPrn:Say(prow, pcol*5 ,Replicate("═", 90) ,oCour_n_10)
oPrn:cmSay( 6.0, 10.0, Replicate( "_", 90 ), oFont,,CLR_BLACK,,PAD_CENTER )
oPrn:CmLine(nLn+0.1,1.8,nLn+0.1,19.0,oPen1)
oPrn:CmLine(nLn+0.2,1.8,nLn+0.2,19.0,oPen1)
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot], nageswaragunupudi, russimicro and 48 guests