Skip to content

Commit

Permalink
Various fixes to browser print functionality by M. Ogi.
Browse files Browse the repository at this point in the history
 - If the Browser was invoked from within the context of a ScreenMan form, pressing <PF1><PF1>P to invoke the Browser print would cause the screen to become corrupted.

 - The ability to print to a CRT is no longer restricted.

 - If the input text to the Browser is passed in a local array, and the printout is queued, the text fail to print.

- The scrolling region was sometimes not getting reset to that needed by the Browser, after printing to a CRT.

- Reduced the Hang time from 2 to 1 after a printing to a CRT. This reduces the chance of the user pressing <RET> before leaving the print screen and returning to the Browser. (<RET> causes the browser window to shift to the right, and could cause some confusion.)

- Question mark (?) help at the prompts before device selection could be corrupted if the Browser is invoked within a ScreenMan context.
  • Loading branch information
Fileman Development committed Mar 4, 2013
1 parent f7534b1 commit 7814c62
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions routines/fileman/DDGLIBP.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
DDGLIBP ;SFISC/MKO-PRINT FROM WITHIN SCREEN TOOLS ;2013-01-22 3:45 PM
;;22.2T1;VA FILEMAN;;Dec 14, 2012;Build 19
DDGLIBP ;SFISC/MKO-PRINT FROM WITHIN SCREEN TOOLS ;2013-03-04
;;22.2V2;VA FILEMAN;;Dec 14, 2012;Build 19
;Per VHA Directive 2004-038, this routine should not be modified.
;
PT(DDGLROOT,DDGLHDR) ;Prompt for device and print
N POP,DDGLBAR,DDGLFLAG,DDGLHELP,DDGLI,DDGLPHDR,DDGLWRAP,DX,DY
N POP,DDGLBAR,DDGLFLAG,DDGLHELP,DDGLI,DDGLPHDR,DDGLREF,DDGLWRAP,DX,DY,DIR0,DDS
N %,%A,%B,%B1,%B2,%B3,%BA,%C,%E,%G,%H,%I,%J,%K,%M,%N
N %P,%S,%T,%W,%X,%Y
N %A0,%D1,%D2,%DT,%J1,%W0
Expand Down Expand Up @@ -53,16 +53,21 @@ S DDGLHELP(2)=" word processing windows."
;
I POP D FINISH("Report canceled!") Q
;
;Check that device is not a CRT
I $E(IOST,1,2)="C-" D QUIT
. D FINISH($C(7)_"You cannot print the document on a CRT.")
;Get the closed root of the array containing the text, resolve values like $J
S DDGLREF=$NA(@$$CREF^DILF($G(DDGLROOT)))
;
;If CRT selected, reset scrolling region to entire screen
I $E(IOST,1,2)="C-" D
. I $D(IOSTBM)#2 N IOTM,IOBM S IOTM=0,IOBM=$G(IOSL,24) W @IOSTBM
. W @IOF
;
;Queue report
I $D(IO("Q")),$D(^%ZTSK) D Q
. N I,ZTRTN,ZTDESC,ZTSAVE,ZTSK,DDGLMSG
. S ZTRTN="PRINT^DDGLIBP"
. S ZTDESC=DDGLHDR
. F I="DDGLROOT","DDGLHDR","DDGLFLAG" S ZTSAVE(I)=""
. F I="DDGLREF","DDGLHDR","DDGLFLAG" S ZTSAVE(I)=""
. I DDGLREF]"" S ZTSAVE($$OREF^DILF(DDGLREF))=""
. D ^%ZTLOAD
. I $D(ZTSK)#2 D
.. W !,"Report queued!",!,"Task number: "_ZTSK,!
Expand All @@ -72,16 +77,16 @@ I POP D FINISH("Report canceled!") Q
. D FINISH($G(DDGLMSG))
;
;Non-queued report
W !,"Printing ..."
D PRINT
I $E(IOST,1,2)="C-" W @IOF W:$D(IOSTBM)#2 @IOSTBM ; Reset bottom margin
X $G(^%ZIS("C"))
D FINISH("Done.")
Q
;
PRINT ;Print the document in DDGLROOT, Header text in DDGLHDR
N DDGLDT,DDGLI,DDGLPAGE,DDGLREF,DDGLZN
S DDGLREF=$$CREF^DILF($G(DDGLROOT))
Q:DDGLREF="" Q:'$D(@DDGLREF)
PRINT ;Print the document in DDGLREF, Header text in DDGLHDR
N DDGLDT,DDGLI,DDGLPAGE,DDGLZN
I $G(DDGLREF)="" D PRINTQ Q
I '$D(@DDGLREF) D PRINTQ Q
;
S DDGLZN=$D(@DDGLREF@($O(@DDGLREF@(0)),0))#2
S DDGLFLAG=$G(DDGLFLAG)
Expand All @@ -107,6 +112,10 @@ D FINISH("Done.")
. W !,$S(DDGLZN:$G(@DDGLREF@(DDGLI,0)),1:$G(@DDGLREF@(DDGLI)))
;
K:$G(DDGLFLAG)'["N" ^UTILITY($J,"W")
D PRINTQ
Q
;
PRINTQ ;Delete the queued task and quit
S:$D(ZTQUEUED) ZTREQ="@"
Q
;
Expand Down Expand Up @@ -145,7 +154,7 @@ S DIR(0)="E" D ^DIR
Q
;
FINISH(DDGLMSG) ;Print message and reset terminal characteristics
I $G(DDGLMSG)]"" W !,DDGLMSG H 2
I $G(DDGLMSG)]"" W !,DDGLMSG H 1
;
;Reset terminal characteristics for screen handling
X DDGLZOSF("EOFF"),DDGLZOSF("TRMON")
Expand Down

0 comments on commit 7814c62

Please sign in to comment.