1 | XGSBOX ;SFISC/VYD - screen rectengular region primitives ;10/31/94 15:38
|
---|
2 | ;;8.0;KERNEL;;Jul 10, 1995
|
---|
3 | FRAME(T,L,B,R,A,C) ;draw a border
|
---|
4 | ;TOP,LEFT,BOTTOM,RIGHT,ATTRIBUTE,frame character
|
---|
5 | N %,%L2,%R2,M,S,X,Y ;M=middle S=string
|
---|
6 | N XGSAVATR
|
---|
7 | I B'>T N IOBLC,IOBRC S (IOBLC,IOBRC)=IOHL ;to draw horizontal line
|
---|
8 | I R'>L N IOTRC,IOBRC S (IOTRC,IOBRC)=IOVL ;to draw vertical line
|
---|
9 | S M=R-L-1
|
---|
10 | S %L2=L+1,%R2=R+1
|
---|
11 | ;if frame character passed set frame parts to it, disable graphics
|
---|
12 | S:$L($G(C)) (IOBLC,IOBRC,IOHL,IOTLC,IOTRC,IOVL)=C
|
---|
13 | S XGSAVATR=XGCURATR ;save current screen attributes
|
---|
14 | W $$CHG^XGSA($G(A)_$S($L($G(C)):"",1:"G1")) ;turn on gr attr & leave on
|
---|
15 | S S=IOTLC_$TR($J("",M)," ",IOHL)_IOTRC
|
---|
16 | S $E(XGSCRN(T,0),%L2,%R2)=S
|
---|
17 | S $E(XGSCRN(T,1),%L2,%R2)=$TR($J("",(R-L+1))," ",XGCURATR)
|
---|
18 | W $$IOXY^XGS(T,L)_S ;top line with corners
|
---|
19 | F Y=T+1:1:B-1 D
|
---|
20 | . F X=%L2,%R2 S $E(XGSCRN(Y,0),X)=IOVL,$E(XGSCRN(Y,1),X)=XGCURATR
|
---|
21 | . W $$IOXY^XGS(Y,L)_IOVL_$$IOXY^XGS(Y,R)_IOVL
|
---|
22 | S S=IOBLC_$TR($J("",M)," ",IOHL)_IOBRC
|
---|
23 | S $E(XGSCRN(B,0),%L2,%R2)=S
|
---|
24 | S $E(XGSCRN(B,1),%L2,%R2)=$TR($J("",(R-L+1))," ",XGCURATR)
|
---|
25 | W $$IOXY^XGS(B,L)_S ;bottom line with corners
|
---|
26 | W $$SET^XGSA(XGSAVATR) ;restore previous attributes
|
---|
27 | D:$L($G(C)) GSET^%ZISS ;restore line drawing characters
|
---|
28 | S $Y=B,$X=R
|
---|
29 | Q
|
---|
30 | ;
|
---|
31 | CLEAR(T,L,B,R) ;clear a portion of the screen
|
---|
32 | N %L2,%R2,I,M ;M=length of middle
|
---|
33 | S %L2=L+1,%R2=R+1,M=R-L+1
|
---|
34 | F I=T:1:B D
|
---|
35 | . S $E(XGSCRN(I,0),%L2,%R2)=$J("",M)
|
---|
36 | . S $E(XGSCRN(I,1),%L2,%R2)=$TR($J("",M)," ",XGCURATR)
|
---|
37 | . W $$IOXY^XGS(I,L)_$J("",M)
|
---|
38 | S $Y=B,$X=R
|
---|
39 | Q
|
---|