FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Consulta sobre TPrinter
Posts: 196
Joined: Fri May 15, 2009 01:25 AM
Consulta sobre TPrinter
Posted: Sat Oct 02, 2010 05:06 AM
Amigos del foro

Al iniciar una rutina de impresi贸n con Preview estoy estableciendo una variable
lImrime := .T.

Si al visualizar mi impresi贸n, decido pulsar sobre el icono de Exit, quisiera saber que instrucci贸n necesito poner para cambiar la variable lImprime := .F., muestro abajo mi c贸digo

Alguien me puede ayudar ?

Muchas gracias


Code (fw): Select all Collapse
 聽 
STATIC FUNCTION ImpFac()
聽 聽 LOCAL oPrn, oFontC, oFontD, oFontE, oFontF, oPen, nRow聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 
聽 聽 LOCAL nSubFac, nDescto1, nDescto2, nImpPar, nSubFac2, nImpIva, nTotFac
聽 聽----
聽 聽----
聽 聽----
聽 聽 
聽 聽 lImprime := .T.

聽 聽PRINT oPrn NAME "Impresi贸n de factura " + "[" + LTRIM(STR(cFacNum,6)) + "]" ;
聽 聽 聽 聽 聽 聽 聽FROM USER PREVIEW

聽 聽 聽 聽 If Empty( oPrn:hDC )
聽 聽 聽 聽 聽 聽 Return NIL
聽 聽 聽 聽 End

聽 聽 聽 聽 DEFINE FONT oFontC NAME "Tahoma" SIZE 0, -8 BOLD OF oPrn
聽 聽 聽 聽 DEFINE FONT oFontD NAME "Tahoma" SIZE 0, -8 OF oPrn
聽 聽 聽 聽 DEFINE FONT oFontE NAME "Tahoma" SIZE 0, -8 BOLD OF oPrn
聽 聽 聽 聽 DEFINE FONT oFontF NAME "Tahoma" SIZE 0, -7 OF oPrn
聽 聽 聽 聽 DEFINE PEN oPen WIDTH 4 OF oPrn
聽 聽 
聽 聽 聽 聽 PAGE
聽 聽 聽 聽 
聽 聽 聽 聽 聽----
聽 聽 聽 聽 聽----
聽 聽 聽 聽 聽----
聽 聽 聽 聽 聽聽 聽
聽 聽 聽 聽 ENDPAGE
聽 聽 ENDPRINT
聽 聽 oFontC:End()
聽 聽 oFontD:End()
聽 聽 oFontE:End()
聽 聽 oFontF:End()
聽 聽 oPen:End()
聽 聽 聽 聽 
聽 聽 
RETURN NIL
Juan Arroyo
M茅xico
FWH 7.12 VERCE 5.3 xHarbour 1.1.0
juan_arroyo_t@hotmail.com
Posts: 592
Joined: Tue Mar 14, 2006 11:34 PM
Re: Consulta sobre TPrinter
Posted: Sat Oct 02, 2010 02:41 PM

Juan,

Se me ocurre al vuelo lo siguiente :

Que tomes el archivo rpreview.prg y lo ajustes, y ya sea usando alguna variable public o global para que tome el valor de la accion y lo compiles como otro .prg a tu app.

Saludos

FWH 10.6 + xHarbour + Borland 582
Posts: 196
Joined: Fri May 15, 2009 01:25 AM
Re: Consulta sobre TPrinter
Posted: Sun Oct 03, 2010 04:19 AM

Raymundo

Gracias por tu respuesta

Tengo poco que pas茅 de clipper a Fivewin y esto de las clases se me hace complicado

Te refieres a que debo declarar la variable como p煤blica dentro de la clase rpreview ?

Mi idea es mostrar la impresi贸n de una factura y que si se pulsa el icono Exit, esto significa que hay algo que modificar en la captura de la factura a trav茅s del nuevo valor de lImprime (que en este caso ser铆a falso) de lo contrario la factura se imprima y se validen los datos de la factura y de las partidas de la misma.

Estoy viendo el archivo rpreview.prg y las l铆neas que muestran el valor de lExit son :

Linea 73 dentro de CLASS Tpreview
DATA lTwoPages, lZoom, lExit

Linea 119 dentro de METHOD NEW ...
::lExit := .F.

Dentro de METHOD Activate ...
Linea 147
::lExit := .T. ,;
Linea 151
StopUntil( { || ::lExit } )

Realmente no se que hacer

Saludos

Juan Arroyo
M茅xico
FWH 7.12 VERCE 5.3 xHarbour 1.1.0
juan_arroyo_t@hotmail.com
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Consulta sobre TPrinter
Posted: Sun Oct 03, 2010 02:19 PM

Hola Juan, creo que puedes hacer lo siguiente:

Busca en el rPreview los botones y menu relacionados con ::oWnd:End() en las llamadas a ::PrintPage() y agregale tu variable static: ( lImprime := .t., ::oWnd:End() ) , o ( lImprime := .f., ::oWnd:End() ), seg煤n el caso. Es s贸lo una idea. Con esto puedes saber si se oprimi贸 el bot贸n de Salida o impresi贸n.
Por ejemplo en:
DEFINE TBBUTTON OF oBar ;
ACTION ::PrintPage() ; //aqui ser铆a .t.
TOOLTIP Strtran(TXT_PRINT,"&","") ;
MESSAGE TXT_PRINT_CURRENT_PAGE

  DEFINE TBSEPARATOR OF oBar

  DEFINE TBBUTTON OF oBar ;
     ACTION  ::oWnd:End() ;   //aqu铆, .f.
     TOOLTIP Strtran( TXT_EXIT, "&", "" ) ;
     MESSAGE TXT_EXIT_PREVIEW

Saludos.

Francisco J. Alegr铆a P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 196
Joined: Fri May 15, 2009 01:25 AM
Re: Consulta sobre TPrinter
Posted: Mon Oct 11, 2010 03:35 PM

Francisco

No habia tenido oportunidad de visitar el foro

Estoy declarando una variable static lImprime en rpreview, ya hice las modificaciones que tu me sugieres, ademas estoy compilando rpreview dentro de mi aplicacion pero no logro ver el valor de lImprime despues que salgo del preview

No es mas aconsejable definir una variable publica lImprime en el programa desde el cual llamo a la rutina de impresi贸n ?

Muchas gracias por tus atenciones

Saludos

Juan Arroyo
M茅xico
FWH 7.12 VERCE 5.3 xHarbour 1.1.0
juan_arroyo_t@hotmail.com
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Consulta sobre TPrinter
Posted: Mon Oct 11, 2010 11:29 PM
Juan escribi贸: Estoy declarando una variable static lImprime en rpreview

Juan, lo que suger铆a es que la variable static lImprime debes declararla al inicio de tu prg principal.
Luego, por ejemplo haces esto:

DEFINE TBBUTTON OF oBar ;
ACTION ( lImprime:=.t., ::PrintPage() ) ; //aqui ser铆a .t.
TOOLTIP Strtran(TXT_PRINT,"&","") ;
MESSAGE TXT_PRINT_CURRENT_PAGE

DEFINE TBSEPARATOR OF oBar

DEFINE TBBUTTON OF oBar ;
ACTION ( lImprime:=.f., ::End() ) ; //aqu铆, .f.
TOOLTIP Strtran( TXT_EXIT, "&", "" ) ;
MESSAGE TXT_EXIT_PREVIEW

Saludos
Francisco J. Alegr铆a P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 196
Joined: Fri May 15, 2009 01:25 AM
Re: Consulta sobre TPrinter
Posted: Wed Oct 13, 2010 04:11 AM

Francisco

Ya hice lo que me indicas

Declar茅 mi variable lImprime al inicio de mi prg principal, hice los cambios en rpreview sin embargo cuando compilo me aparecen mensajes de error

Warning W0001 Ambiguos reference 'LIMPRIME'

Podr铆a mandarte mis archivos (2) capfac.prg y rpreview.prg en un zip a alguna direcci贸n de correo ?

Saludos

Juan Arroyo
M茅xico
FWH 7.12 VERCE 5.3 xHarbour 1.1.0
juan_arroyo_t@hotmail.com

Continue the discussion