source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SDUL4.m@ 1742

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

initial load of FOIAVistA 6/30/08 version

File size: 3.3 KB
Line 
1SDUL4 ;ALB/MJK - Screen Malipulation Utilities ; 12/1/91
2 ;;5.3;Scheduling;;Aug 13, 1993
3 ;
4NEXT ; -- display next screen (NX)
5 N SDULSTO,I,LN
6 I SDULBG+SDUL("LINES")>SDULCNT W *7 G NEXTQ
7 S SDULBG=SDULBG+SDUL("LINES")
8 S SDULSTO=SDULST
9 I SDULCC D LST,SCROLL D
10 .S DX=0,DY=SDUL("BM")-1 X IOXY
11 .S I=SDULSTO+1 F LN=1:1:SDUL("LINES") W !,$G(@SDULAR@(+$$GET(I),0)) S I=I+1
12 .S SDULBCK="" D PLUS,RESET
13 D PGUPD
14NEXTQ D FINISH Q
15 ;
16PREV ; -- display previous screen (BU)
17 N I,LN,X,Y,SDULBGO
18 I SDULBG=1 W *7 G PREVQ
19 S Y=SDULBG-SDUL("LINES")
20 S SDULBGO=SDULBG,SDULBG=$S(Y<1:1,1:Y)
21 I SDULCC D LST,SCROLL D
22 .S DX=0,DY=SDUL("TM")-1
23 .S I=SDULBGO-1 F LN=1:1:SDUL("LINES") D IOXY W $G(@SDULAR@(+$$GET(I),0)) Q:I=1 S I=I-1
24 .S SDULBCK="" D PLUS,RESET
25 D PGUPD
26PREVQ D FINISH Q
27 ;
28FIRST ; -- display first screen (FS)
29 I SDULBG=1 W *7 G FIRSTQ
30 S SDULBG=1
31 I SDULCC D LST,PAINT
32 D PGUPD
33FIRSTQ D FINISH Q
34 ;
35LAST ; -- display last screen (LS)
36 N Y,I
37 I SDULCNT'>SDUL("LINES") W *7 G LASTQ
38 ; first line of the last screen :=
39 ; (# of full screens less 1 if last screen is also full) x # lines per screen) + 1 line
40 S Y=(((SDULCNT\SDUL("LINES"))-'(SDULCNT#SDUL("LINES")))*SDUL("LINES"))+1
41 I Y=SDULBG W *7 G LASTQ
42 S SDULBG=Y
43 I SDULCC D LST,PAINT
44 D PGUPD
45LASTQ D FINISH Q
46 ;
47UP ; -- display last screen (UP)
48 N Y
49 S Y=SDULBG-1
50 I Y<1 W *7 G UPQ
51 S SDULBG=Y D LST
52 I SDULCC D SCROLL S DX=0,DY=SDUL("TM")-1 D IOXY W $G(@SDULAR@(+$$GET(SDULBG),0)) D PLUS,RESET
53 D PGUPD
54UPQ D FINISH Q
55 ;
56DOWN ; -- display next line (DN)
57 N Y
58 S Y=SDULST+1
59 I Y>SDULCNT W *7 G DOWNQ
60 S SDULBG=SDULBG+1,SDULST=Y
61 I SDULCC D SCROLL S DX=0,DY=SDUL("BM")-1 X IOXY W !,$G(@SDULAR@(+$$GET(SDULST),0)) D PLUS,RESET
62 D PGUPD
63DOWNQ D FINISH Q
64 ;
65FINISH ; -- finish action
66 S SDULBCK=$S(SDULCC:"",1:"R")
67 Q
68 ;
69PAINT ;
70 N I,LN,X D SCROLL
71 I $E(IOST,1,4)="C-VT" S DX=0,DY=SDUL("TM")-1 X IOXY W *27,*91,SDUL("LINES"),*77
72 S I=SDULBG F LN=1:1:SDUL("LINES") S DX=0,DY=SDUL("TM")+LN-2 D IOXY W $G(@SDULAR@(+$$GET(I),0)) S I=I+1
73 S SDULBCK="" D PLUS,RESET
74 Q
75 ;
76IOXY ; -- position cursor ; insert line ; cr
77 W ! X IOXY W IOIL,$C(13)
78 Q
79 ;
80RE ; -- re-display current screen (RE)
81 D REFRESH^SDUL S SDULBCK=""
82 Q
83 ;
84RESET ; -- reset scrolling region to bottom of screen
85 S DX=0,DY=SDUL("BM")+1 X IOXY W IOEDEOP
86 S IOTM=SDUL("BM")+2,IOBM=IOSL W IOSC W @IOSTBM W IORC
87 D UND($$LOWER^SDUL1($$NOW^SDUL1),31,1,21,0)
88 I $D(SDULBCK) S DX=0,DY=SDUL("BM") X IOXY
89 Q
90 ;
91SCROLL ; -- set scrolling region to list area
92 S IOTM=SDUL("TM"),IOBM=SDUL("BM") W IOSC W @IOSTBM W IORC
93 Q
94 ;
95LST ; -- compute last line on screen
96 N I
97 S I=SDULBG+SDUL("LINES")-1,SDULST=$S($D(@SDULAR@(+$$GET(I),0)):I,1:SDULCNT)
98 Q
99 ;
100GET(LNUM) ; -- get actual line number (may be different if indexed)
101 Q $S(SDUL(0)["I":$G(@SDULIDX@(LNUM)),1:LNUM)
102 ;
103PLUS ; -- add plus indicators to screen
104 N UP,DN
105 S UP=(SDULBG'=1),DN=$S('$D(SDULST):0,SDUL(0)["I":$O(@SDULIDX@(+SDULST))>0,1:$O(@SDULAR@(+SDULST))>0)
106 I UP'=SDULUP S SDULUP=UP D UND($S(UP:"+",1:" "),1,SDUL("TM")-1,1)
107 I DN'=SDULDN S SDULDN=DN D UND($S(DN:"+",1:" "),1,SDUL("BM")+1,1)
108 Q
109 ;
110PGUPD ; -- update page var and screen
111 N P
112 S P=$$PAGE(SDULBG,SDUL("LINES")) G PGUPDQ:P=SDULPGE
113 S SDULPGE=P
114 D:SDULCC UND($J(P,3),71,1,3,0)
115PGUPDQ Q
116 ;
117PAGE(BEG,LINES) ; -- calc page #
118 Q (BEG\LINES)+((BEG#LINES)>0)
119 ;
120UND(STR,X,Y,LEN,ERASE) ;
121 W IOUON,$C(13) D INSTR^SDUL1(STR,X,Y,LEN,+$G(ERASE)) W $C(13),IOUOFF
122 Q
Note: See TracBrowser for help on using the repository browser.