Focus issue with printing

Focus issue with printing

Postby TimStone » Thu Aug 23, 2007 11:18 pm

I use the tPrinter class for all reports and printouts.

Here is the setup. The program has a button to call a function which creates a printed invoice. The ACTION statement of the button calls the invoice printing function. The user then gets to choose the printer ( default or select a printer ) and if it is directly printed, or previewed. Once the selection is made, the invoice is printed ( or previewed ), and then the main invoice screen reappears.

In a few locations the clients are seeing the following behavior suddenly. The printer selection window appears, and if they select an alternate printer, which calls the windows printer selection screen, or sometimes when they select the preview, there are some flashes and the print screen(s) lose focus, and the main invoice dialog returns. There are no icons for the print dialogs on the task bar.

Has anyone seen this type of behavior and developed a process by which the function called by a button must complete before the calling dialog can regain focus ?

The call is simple: REDEFINE BUTTON oBtn ACTION PrintInvoice()

Your thoughts and ideas are appreciated !

BTW, this is a new behavior but not related to a newer version of FWH. The computers are older ( 333 MHz, 256 MB RAM, dot matrix printers, shared ).

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Postby Antonio Linares » Fri Aug 24, 2007 7:49 am

Tim,

You can disable the calling dialog with oDlg:Disable() and then enable it again with oDlg:Enable() once the process finishes
regards, saludos

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

Focus

Postby TimStone » Fri Aug 24, 2007 6:00 pm

I have managed to get some of this under control. Using the command:

DEFINE BUTTON abc OF oDlg ACTION ( PrintInvoice( ), oDlg:setfocus( ) )

will bring the dialog back into focus instead of having the focus go elsewhere to another active dialog. HOWEVER, if I do a preview ( rpreview ), I find that the preview activates another window ( correct behavior ), but once that window is painted, rpreview passes control back to the calling program which then sets the calling dialog in focus, leaving the print window open in the background.

You use a stop in rpreview, but the VALID clause automatically sets the value to .t. so the stop doesn't work. The desired behavior is to not return to the calling dialog until the preview window is closed.

Thoughts on this ?

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Postby Antonio Linares » Fri Aug 24, 2007 6:20 pm

Tim,

You can set the preview to behave MODAL:

PRINT oPrn PREVIEW MODAL
...
ENDPRINT
regards, saludos

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

MODAL`

Postby TimStone » Fri Aug 24, 2007 7:52 pm

I've got two copies of this program I'm working on. The new one is with the current FWH and xHarbour, and the other, which I use for release purposes, is with the January releases.

The current one I set to MODAL ... forgot to do it on the older one which is the one I test/distribute.

I'll give that a try.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 55 guests