Page 1 of 1

Imprimir un dialog

Posted: Mon Nov 07, 2016 1:28 pm
by Loren
Buenas tardes, compañeros:

¿ Puedo imprimir un dialog rápidamente?

Algo así como

Code: Select all

funct IMP_Dialog(oDialog,nTop, nLeft, nWidth, nHeight)
   PRINT oPrn NAME "Impresión de un Dialog" PREVIEW
      oPrn:Cmtr2Pix(@nTop  , @nLeft)
      oPrn:Cmtr2Pix(@nWidth, @nHeight)
      PAGE
         oDialog:Print( oPrn, nTop, nLeft, nWidth, nHeight )
      ENDPAGE
   ENDPRINT
return
Estoy probando este código, pero me genera un preview en blanco.

Gracias.
Un saludo.

Re: Imprimir un dialog

Posted: Mon Nov 07, 2016 4:05 pm
by AngelSalom
En samples\testprn.prg tienes este código :

Code: Select all

// Printing a whole window sample
// You may use also :hardCopy() method without creating a PRINT object

#include "FiveWin.ch"

static oWnd

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

function Main()

   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()  // try also with oWnd:HardCopy()

   ACTIVATE WINDOW oWnd

return nil

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

function PrintMe()

   local oPrn

   PRINT oPrn NAME "Test"
      PAGE
         oWnd:Print( oPrn, 1, 1, 2 )        // Scale factor 2
      ENDPAGE
   ENDPRINT

return nil

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

Re: Imprimir un dialog

Posted: Mon Nov 07, 2016 5:19 pm
by Antonio Linares
oDlg:HardCopy()

METHOD HardCopy( nScale, lFromUser ) en window.prg

Re: Imprimir un dialog

Posted: Mon Nov 07, 2016 7:58 pm
by Loren
Angel, gracias. Este código funcion para una twindows, pero NO para Dialogs

Antonio, mil gracias.... funcionó perfect y me ahorré tiempo y mucho código fuente!!.