Efecto Pijama en PRINT

Efecto Pijama en PRINT

Postby acuellar » Sun Dec 04, 2022 2:51 pm

Buenas estimados

Lo hago así
Code: Select all  Expand view

 If nCln%2=0
          DEFINE BRUSH oBrush COLOR RGB( 220, 235, 252 )
          @nLn+0.1,9.3 PRINT TO oPrn TEXT Tran(INDT->D1,cPic) FONT oFont6 COLOR CLR_BLACK,oBrush CM
          RELEASE BRUSH oBrush
        Else
          DEFINE BRUSH oBrush COLOR CLR_WHITE
          @nLn+0.1,9.3 PRINT TO oPrn TEXT Tran(INDT->D1,cPic) FONT oFont6 COLOR CLR_BLACK,oBrush CM
          RELEASE BRUSH oBrush
        Endif
 

Pero llena toda la página con el Brush :(

Cómo se hace?

Gracias por la ayuda
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1643
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Efecto Pijama en PRINT

Postby Antonio Linares » Mon Dec 05, 2022 9:15 am

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Efecto Pijama en PRINT

Postby acuellar » Mon Dec 05, 2022 11:27 am

Muchas gracias estimado Antonio

ACTIVATE REPORT oReport ON STARTLINE AEval( oReport:aColumns, { | o | o:lShadow := ! o:lShadow } )
y cómo se aplica para el PRINT

Code: Select all  Expand view

 PRINT oPrn NAME "DETALLE DE MOVIMIENTOS" PREVIEW
 


Gracias por la ayuda
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1643
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Efecto Pijama en PRINT

Postby karinha » Mon Dec 05, 2022 11:34 am

Mira se ayuda:

Code: Select all  Expand view

// \samples\SHADOW.PRG - 20/10/2020 - kapiabafwh@gmail.com

#include "fivewin.ch"

#define PAD_LEFT            0
#define PAD_RIGHT           1
#define PAD_CENTER          2

FUNCTION Imp_Silvio()

   LOCAL oPrn, oFont, oFont2, oFont3, oPen, oPen1, oPen2, oPen3, cFiveWin
   LOCAL nLinI, nColI, nLinF, nColF, oBrush
   LOCAL ResLinha, ResColuna, nLinha, nColuna
   LOCAL nLinTopBox, nColTopBox, nLinBotBox, nColBotBox
   LOCAL ShadowIni, ShadowFin

   PRINT oPrn NAME "TEST SILVIO BOX SHADOW..." PREVIEW

      DEFINE BRUSH oBrush COLOR nRGB( 215, 215, 215 )

      DEFINE FONT oFont  NAME "Arial" SIZE 0, - 6  BOLD           OF oPrn
      DEFINE FONT oFont2 NAME "Arial" SIZE 0, - 12 BOLD Underline OF oPrn
      DEFINE FONT oFont3 NAME "Arial" SIZE 0, - 18 BOLD           OF oPrn

      DEFINE PEN oPen  WIDTH 1  COLOR CLR_BLACK                   OF oPrn
      Define Pen oPen1 Width 50 COLOR nRgb( 192, 192, 192 )
      DEFINE PEN oPen2 WIDTH 2  COLOR CLR_BLACK                   OF oPrn
      // aqui Silvio:
      DEFINE PEN oPen3 WIDTH 410 COLOR nRgb( 192, 192, 192 )      OF oPrn

      oPrn:SetPage( 9 )  // A4
      oPrn:SetPortrait() //Vertical

      ResLinha  := oPrn:nLogPixely() / 2.54
      ResColuna := oPrn:nLogPixelx() / 2.54

      PAGE

        nLinha  := 1.00
        nColuna := 5.5

        nLinTopBox :=  1.50  //-> Linha Que o Box Inicia Topo
        nColTopBox := 14.00  //-> Largura do Box
        nLinBotBox :=  2.50  //-> Tamanho do Box de Cima Para Baixo
        nColBotBox :=  8.00  //-> Coluna Que o Box Inicia

        oPrn:Cmtr2Pix( @nLinTopBox, @nColTopBox )
        oPrn:cmtr2Pix( @nLinBotBox, @nColBotBox )

        /* // otro modo
        ShadowIni := oPrn:Cmtr2Pix( nLinTopBox, 6.5 )

        ShadowFin :=  oPrn:cmtr2Pix( nLinBotBox, 14.5 )
        */


        // Shadow Box
        oPrn:Box( nLinTopBox, nColTopBox, nLinBotBox, nColBotBox, oPen3 )

        // oPrn:FillRect( { ShadowIni[1], ShadowIni[2], ShadowFin[1], ShadowFin[2] }, oBrush )

        nColuna := nColuna += 2.10

        // oPrn:cmSay( 1, 5.5, "Tipo documento", oFont, 4.5, CLR_BLACK, , PAD_LEFT  )
        oPrn:Say( nLinha * ResLinha, nColuna * ResColuna,                    ;
           + "Tipo documento:", oFont,, CLR_BLACK,, PAD_LEFT )

        nLinha  := nLinha += 0.50
        nColuna := 10.5

        //oPrn:cmSay( 1, 5.5, "DESCRIZIONE DOCUMENTO", oFont2, 4.5, CLR_BLACK, , PAD_CENTER  )
        oPrn:Say( nLinha * ResLinha, nColuna * ResColuna,                    ;
           + "DESCRIZIONE DOCUMENTO", oFont2,, CLR_BLACK,, PAD_CENTER )

        nLinha  := nLinha += 0.80

        oPrn:Say( nLinha * ResLinha, nColuna * ResColuna,                    ;
           + "Silvio Falconi Corporation And FiveWin", oFont,, CLR_BLACK,, PAD_LEFT )

      ENDPAGE

   ENDPRINT

   oPen:End()
   oPen1:End()
   oPen2:End()
   oPen3:End()

   oFont:End()
   oFont2:End()
   oFont3:End()

RETURN NIL

//-> viewtopic.php?f=3&t=39498

/*
Silvio.Falconi escribió:
METHOD Box( nTop, nLeft, nBottom, nRight, ;
[Pen], ; // oPen/hPen/nColor/{nColor,nThickness}
[Brush], ; // nColor / oBrush
[aText], ; // { cText, oFont, nColor } Painted in center
cUnits ; // "CM", "MM", "INCHES"
)

I tried to use aText array but I can set only { cText, oFont, nColor } and it was printed in center
How I can to print it with align ?


Now, aText can be { cText, oFont, nTxtColor, cAlign }

cAlign:
"TL" : TopLeft
"TR" : TopRight
"T" : Top Center
"BL" : Bottom Left
"BR" : Bottom Right
"B" : Bottom Center
"L" : Left Vert Center
"R" : Right Vert Center

But you can use this for only String, though this string can be multi-line delimited by CRLF.
If you want to print 2 or more strings with different alignments, you need to write your own code for that
*/


function PrnBox()

   local oPrn, oFont, oBrush

   DEFINE BRUSH oBrush FILE "c:\fwh\bitmaps\backgrnd\pebbles.bmp"
   PRINT oPrn PREVIEW
   DEFINE FONT oFont NAME "VERDANA" SIZE 0,-30 OF oPrn BOLD

   PAGE
   oPrn:RoundBox( 1, 1, 5, 5, .5, .5, { CLR_HRED, 3 }, oBrush, ;
                  { "FIRST" + CRLF + "SECOND", oFont, CLR_WHITE, "B" }, ;
                  "INCHES" )
   @ 1,1 PRINT TO oPrn TEXT "HOLLOW TEXT" SIZE 4, 4 INCHES FONT oFont ;
         COLOR CLR_YELLOW OUTLINE CLR_HRED SIZE 3 ALIGN "T"

   ENDPAGE
   ENDPRINT

   RELEASE FONT oFont
   RELEASE BRUSH oBrush

return nil
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Efecto Pijama en PRINT

Postby karinha » Mon Dec 05, 2022 11:44 am

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Efecto Pijama en PRINT

Postby karinha » Mon Dec 05, 2022 12:16 pm

Prefecto!


Code: Select all  Expand view

// C:\FWH..\SAMPLES\PIJAMA3.PRG

#Include "FiveWin.ch"

FUNCTION PrintZebra()

   LOCAL oPrn, oFont, oBrushColor, oBrush, nRow

   USE STATES
   GO TOP

   PRINT oPrn PREVIEW

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0, -14 OF oPrn
   DEFINE BRUSH oBrushColor COLOR CLR_HGRAY

   PAGE

   nRow := 0.5

   @ nRow, 1.0 PRINT TO oPrn TEXT "EFECTO PIJAMA" SIZE 3.0, 0.3 INCHES ;
      ALIGN "T" FONT oFont COLOR CLR_BLACK, oBrush

   nRow := 1.0

   WHILE STATES->( RECNO() ) < 15 .AND. .NOT. STATES->( EOF() )

      SYSREFRESH()

      @ nRow, 1.0 PRINT TO oPrn TEXT STATES->CODE SIZE 1.0, 0.3 INCHES ;
         ALIGN "L" FONT oFont COLOR CLR_BLACK, oBrush

      @ nRow, 2.0 PRINT TO oPrn TEXT STATES->NAME SIZE 3.0, 0.3 INCHES ;
         ALIGN "L" FONT oFont COLOR CLR_BLACK, oBrush

      nRow += 0.3

      oBrush := IF( oBrush == NIL, oBrushColor, NIL )

      STATES->( DbSkip( 1 ) )

   ENDDO

   ENDPAGE
   ENDPRINT

   RELEASE FONT oFont
   RELEASE BRUSH oBrushColor

RETURN NIL

/*
cAlign:
"TL" : TopLeft
"TR" : TopRight
"T"  : Top Center
"BL" : Bottom Left
"BR" : Bottom Right
"B"  : Bottom Center
"L"  : Left Vert Center
"R"  : Right Vert Center
*/

 
// FIN / END
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Efecto Pijama en PRINT

Postby acuellar » Mon Dec 05, 2022 4:58 pm

Prefecto.

Gracias Joao
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1643
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 91 guests