Preview

Preview

Postby Ugo » Wed Mar 04, 2009 9:35 am

Dear all,
when start the print preview from a dialog, it is open into the main windows, under the dialog. :(
I need open it in another window, or that the printer open up the dialog.
Ciao, best regards,
Ugo
User avatar
Ugo
 
Posts: 283
Joined: Sat Oct 15, 2005 6:40 am
Location: Turin, Italy

Re: Preview

Postby Ugo » Wed Mar 04, 2009 9:24 pm

Dear all,
this is the a reduced and self-contained sample:
Code: Select all  Expand view
FUNCTION Main()

   LOCAL oWnd

   DEFINE Window oWnd MDI
   ACTIVATE WINDOW oWnd ON INIT ( /*oWnd:Hide(),*/ Start( oWnd ) ) // MINIMIZED
   RETURN Nil

STATIC FUNCTION start( oWnd )

   LOCAL oDlg, oBtt

   DEFINE DIALOG oDlg OF oWnd

   @ 1,1 BUTTON oBtt ACTION PrintTest( oWnd )

   ACTIVATE DIALOG oDlg CENTERED
   oWnd:END()

   RETURN Nil

STATIC FUNCTION PrintTest( oWnd )
   LOCAL oPrn, oDlg
   PRINT oPrn NAME "Test fivewin" PREVIEW MODAL

   // IF Empty( oPrn:hDC )
   // IF oPrn:hDC <> 0
      // MsgStop( cPrinter + " is not ready!!" )
   // ELSE
   //    MsgINfo( "Printing!" )
   // ENDIF

   DEFINE dialog oDlg OF oWnd
   ACTIVATE DIALOG oDlg CENTERED NOWAIT
   Inkey( 1 )

   PAGE
   oPrn:CmSay(  10.3 , 15.0, "TEST" )
   ENDPAGE
   Inkey( 1 )

   oDlg:END()

   ENDPRINT

   MsgInfo( "Print end" )

   RETURN Nil


The problem is that the focus is on the dialog oDlg in Start function;
is possible to close the preview only after to have closed the dialog.
Ciao, best regards,
Ugo
User avatar
Ugo
 
Posts: 283
Joined: Sat Oct 15, 2005 6:40 am
Location: Turin, Italy

Re: Preview

Postby Otto » Wed Mar 04, 2009 9:38 pm

Ugo,
maybe this thread can help you.

viewtopic.php?f=3&t=14629&p=75810&hilit=preview+mdi#p75810

Regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: Preview

Postby Ugo » Wed Mar 04, 2009 9:44 pm

Otto wrote:Ugo,
maybe this thread can help you.

viewtopic.php?f=3&t=14629&p=75810&hilit=preview+mdi#p75810


Dear Otto,

I read that post, but I did not understand what must change!
Ciao, best regards,
Ugo
User avatar
Ugo
 
Posts: 283
Joined: Sat Oct 15, 2005 6:40 am
Location: Turin, Italy

Re: Preview

Postby Otto » Wed Mar 04, 2009 9:49 pm

Ugo,
if you want the behavior Fivewin had before you must change rpreview.prg and link in the changed one.
Search for MDICHILD and comment it out.

DEFINE WINDOW ::oWnd ;
TITLE cTitle ;
COLOR CLR_BLACK,CLR_LIGHTGRAY ;
ICON oIcon ;
VSCROLL HSCROLL
//MDICHILD



Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: Preview

Postby Ugo » Wed Mar 04, 2009 10:03 pm

Otto wrote:Ugo,
if you want the behavior Fivewin had before you must change rpreview.prg and link in the changed one.
Search for MDICHILD and comment it out.

DEFINE WINDOW ::oWnd ;
TITLE cTitle ;
COLOR CLR_BLACK,CLR_LIGHTGRAY ;
ICON oIcon ;
VSCROLL HSCROLL
//MDICHILD


Dear Otto,
now I understood,
many thanks,
I don't know why i don't see!
Uhm, I'm tired? :-)
Ciao, best regards,
Ugo
User avatar
Ugo
 
Posts: 283
Joined: Sat Oct 15, 2005 6:40 am
Location: Turin, Italy

Re: Preview

Postby nageswaragunupudi » Wed Apr 22, 2009 10:51 am

I suggest the following small modification to RPreview.Prg. If the printer is defined with PREVIEW and MODAL clauses, the preview will now create a normal window, but not an mdichild.

Proposed modification in BuildWindow method of TPreview Class ( line 386 in 0.04 version )
Code: Select all  Expand view

   if !::oDevice:lPrvModal .and. ;  // now added
       ::oWndMain != nil .and. Upper( ::oWndMain:ClassName() ) == "TMDIFRAME"
 

Also I propose the following modification in report.prg ( line 253 )
Code: Select all  Expand view

      ::oDevice := TPrinter():New( cName, .f., .t., nil, .t. )  // last 2 params now added
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 88 guests