source: WorldVistAEHR/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XGS.m@ 1226

Last change on this file since 1226 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.9 KB
RevLine 
[613]1XGS ;SFISC/VYD - SCREEN PRIMITIVES ;03/16/95 11:00
2 ;;8.0;KERNEL;;Jul 10, 1995
3SAY(R,C,S,A) ;use this for coordinate output instead of WRITE
4 ;output to screen and update virtual screen (XGSCRN)
5 ;params: Row (0-IOSL),Col (0-IOM),string,
6 ;scrn attrib ie. I1R0B1 (optional)
7 N XGSAVATR,XGESC,XGOUTPUT ;save attribute,escape str,output stream
8 N %
9 ;set output stream to either XGSCRN (virtual screen) or some window
10 S XGOUTPUT=$S($G(XGFLAG("PAINT"),21)=21:"XGSCRN",1:$NA(^TMP("XGS",$J,XGW1)))
11 S XGSAVATR=XGCURATR ;preserve current attribute to restore later
12 S $X=C+$L(S)
13 S XGESC=$S($L($G(A)):$$CHG^XGSA(A),1:"")
14 S $E(@XGOUTPUT@(R,0),(C+1),$X)=S
15 S $E(@XGOUTPUT@(R,1),(C+1),$X)=$TR($J("",$L(S))," ",XGCURATR)
16 ;S $P(%,XGCURATR,$L(S)+1)="",$E(@XGOUTPUT@(R,1),(C+1),$X)=%
17 I XGOUTPUT="XGSCRN" D I 1 ;if screen painting is to occur
18 . ;output string in a proper place in proper attribute and restore attr
19 . ;W $$IOXY(R,C)_XGESC_S_$S($L($G(A)):$$SET^XGSA(XGSAVATR),1:"")
20 . W $$IOXY(R,C)_XGESC_S_$S(XGSAVATR'=XGCURATR:$$SET^XGSA(XGSAVATR),1:"")
21 . S $Y=R,$X=C+$L(S)-1
22 E S XGCURATR=XGSAVATR
23 Q
24 ;
25 ;
26SAYU(R,C,S,A) ;use this for coordinate output instead of WRITE
27 ;output to screen and update virtual screen (XGSCRN)
28 ;params: Row (0-IOSL),Col (0-IOM),string,
29 ;scrn attrib ie. I1R0B1 (optional)
30 N XGSAVATR,XGESC,XGOUTPUT ;save attribute,escape str,output stream
31 N %,%S,P,P1,P2,X ;P1:piece before &, P2:piece from & to the end
32 N XGATR
33 ;set output stream to either XGSCRN (virtual screen) or some window
34 S XGOUTPUT=$S($G(XGFLAG("PAINT"),21)=21:"XGSCRN",1:$NA(^TMP("XGS",$J,XGW1)))
35 S P=$L(S,"&&")
36 F %=1:1:P S $P(X,$C(1),%)=$P(S,"&&",%) ;replace all && with $C(1)
37 I X["&",$G(A)'["U1",'$$STAT^XGSA("U")!($G(A)["U0") D I 1
38 . S XGSAVATR=XGCURATR ;preserve current attribute to restore later
39 . S XGESC=$S($L($G(A)):$$CHG^XGSA(A),1:"")
40 . S XGATR=XGCURATR ;get pre-underline attributes
41 . S $X=C+$L(X)-1 ;adjust for a single &, which is not printable
42 . ;S $E(XGSCRN(R,0),(C+1),$X)=$TR($TR(X,"&",""),$C(1),"&")
43 . S $E(@XGOUTPUT@(R,0),(C+1),$X)=$TR($P(X,"&")_$P(X,"&",2,999),$C(1),"&")
44 . S $E(@XGOUTPUT@(R,1),(C+1),$X)=$TR($J("",$X-C)," ",XGCURATR)
45 . S P1=$TR($P(X,"&"),$C(1),"&"),P2=$TR($P(X,"&",2,999),$C(1),"&")
46 . S %S=P1_$$CHG^XGSA("U1")_$E(P2) ;preunderline_underlinechar
47 . S $E(@XGOUTPUT@(R,1),(C+1+$L(P1)))=XGCURATR ;record underlinechar
48 . ;S %S=%S_$$CHG^XGSA("U0")_$E(P2,2,999) ;%S_postunderline
49 . S %S=%S_$$SET^XGSA(XGATR)_$E(P2,2,999) ;%S_postunderline
50 . I XGOUTPUT="XGSCRN" D I 1
51 . . ;output string in a proper place in proper attribute and restore attr
52 . . ;W $$IOXY(R,C)_XGESC_%S_$S($L($G(A)):$$SET^XGSA(XGSAVATR),1:"")
53 . . W $$IOXY(R,C)_XGESC_%S_$S(XGCURATR'=XGSAVATR:$$SET^XGSA(XGSAVATR),1:"")
54 . . S $Y=R,$X=C+$L(X)-2
55 . E S XGCURATR=XGSAVATR
56 E D SAY(R,C,$TR(S,"&"),A):$D(A),SAY(R,C,$TR(S,"&")):'$D(A)
57 Q
58 ;
59 ;
60IOXY(R,C) ;cursor positioning WRITE argument instead of execute
61 ;Row,Col
62 Q $C(27,91)_((R+1))_$C(59)_((C+1))_$C(72)
Note: See TracBrowser for help on using the repository browser.