Seleccionar número copias en el preview

Seleccionar número copias en el preview

Postby leandro » Fri Nov 12, 2021 7:49 pm

Hola buenas tardes para todos

No se si es posible colocar en la barra del preview (rpreview.prg) un get o un combobox para que el usuario desde la previsualización, pueda seleccionar el numero de copias a imprimir.

Image

Code: Select all  Expand view

// Sample showing how to manage the printer object

#include "FiveWin.ch"

static oWnd

//----------------------------------------------------------------------------//

function Main()

   local oPrn, oFont
   local nRowStep, nColStep
   local nRow := 0, nCol := 0, n, m

   // PrnSetSize( 2100, 1200 )     To adjust a different printer paper size!

   PRINT oPrn NAME "Testing the printer object from FiveWin" PREVIEW

      if Empty( oPrn:hDC )
         return nil          // Printer was not installed or ready
      endif

      DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0, -12 OF oPrn

      nRowStep = oPrn:nVertRes() / 20   // We want 20 rows
      nColStep = oPrn:nHorzRes() / 15   // We want 15 cols

      PAGE
         oPrn:SayBitmap( 1, 1, "..\bitmaps\fivewin.bmp" )
         for n = 1 to 20  // rows
             nCol = 0
             oPrn:Say( nRow, nCol, Str( n, 2 ), oFont )
             nCol += nColStep
             for m = 1 to 15
                oPrn:Say( nRow, nCol, "+", oFont )
                nCol += nColStep
             next
             nRow += nRowStep
         next
         oPrn:Line( 0, 0, nRow, nCol )
      ENDPAGE

      PAGE
         nRow = 0
         oPrn:SayBitmap( 1, 1, "..\bitmaps\fivewin.bmp" )
         for n = 1 to 20  // rows
             nCol = 0
             oPrn:Say( nRow, nCol, Str( n + 20, 2 ), oFont )
             nCol += nColStep
             for m = 1 to 15
                oPrn:Say( nRow, nCol, "+", oFont )
                nCol += nColStep
             next
             nRow += nRowStep
         next
         oPrn:Line( 0, 0, nRow, nCol )
      ENDPAGE

   ENDPRINT

   oFont:End()      // Destroy the font object

return nil

//----------------------------------------------------------------------------//

procedure AppSys  // XBase++ requirement

return

//----------------------------------------------------------------------------//

 
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1643
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

Re: Seleccionar número copias en el preview

Postby karinha » Fri Nov 12, 2021 10:42 pm

Simples, ponga en el diálogo, asi:

Code: Select all  Expand view

#include "FiveWin.ch"

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

static oWnd

MEMVAR nCopias

function Main()

   nCopias   := 5  // 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()

   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
   Local nLinI, nColI, nLinF, nColF

   PRINT oPrn NAME "Impresión en Vertical.." // 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 )

         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

   oFont:End()

return nil
 


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


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Cgallegoa, Google [Bot] and 26 guests