source: WorldVistAEHR/trunk/r/LIST_MANAGER-VALM/VALM10.m@ 771

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1VALM10 ;MJK;09:29 PM 17 Jan 1993;
2 ;;1;List Manager;;Aug 13, 1993
3 ;
4CNTRL(LINE,COL,WIDTH,ON,OFF,SAVE) ; -- set video control chars
5 ; input: LINE := line number
6 ; COL := column to start control
7 ; WIDTH := how many characters should contrl be in effect
8 ; ON := beginninng control code (ex. the value of IOINHI)
9 ; OFF := ending control code (ex. the value of IOINORM)
10 ; SAVE := 1 to save control code for later use
11 ; otherwise 0 [optional]
12 ;
13 S X="VALM VIDEO"_$S($G(SAVE):" SAVE",1:"")
14 S ^TMP(X,$J,VALMEVL,LINE,COL,WIDTH)=ON
15 S ^TMP(X,$J,VALMEVL,LINE,COL+WIDTH,0)=OFF
16 Q
17 ;
18KILL(LINE) ; -- kill off video cntrls for a line
19 ; input: LINE := line number
20 ;
21 K:'$D(LINE) ^TMP("VALM VIDEO",$J,VALMEVL),^TMP("VALM VIDEO SAVE",$J,VALMEVL)
22 K:$D(LINE) ^TMP("VALM VIDEO",$J,VALMEVL,LINE),^TMP("VALM VIDEO SAVE",$J,VALMEVL,LINE)
23 Q
24 ;
25SAVE(LINE) ; -- save video cntrls for a line
26 ; input: LINE := line number
27 ;
28 D SWAP("^TMP(""VALM VIDEO"",$J,VALMEVL,LINE)","^TMP(""VALM VIDEO SAVE"",$J,VALMEVL,LINE)")
29 Q
30 ;
31RESTORE(LINE) ; -- restore video cntrls for a line
32 ; input: LINE := line number
33 ;
34 D SWAP("^TMP(""VALM VIDEO SAVE"",$J,VALMEVL,LINE)","^TMP(""VALM VIDEO"",$J,VALMEVL,LINE)")
35 Q
36 ;
37SWAP(FR,TO,SAVE) ; -- swap video cntrl arrays
38 ; [not a supported call]
39 ;
40 K @TO
41 S COL=0
42 F S COL=$O(@FR@(COL)) Q:'COL D
43 .N WIDTH S WIDTH=""
44 .F S WIDTH=$O(@FR@(COL,WIDTH)) Q:WIDTH="" S @TO@(COL,WIDTH)=@FR@(COL,WIDTH)
45 K:'$G(SAVE) @FR
46 Q
47 ;
48SELECT(LINE,MODE) ; -- highlight/unhighlight a line
49 ; input: LINE := line number
50 ; MODE := 1 to highlight line
51 ; 0 to unhighlight and restore to original state
52 ;
53 I MODE D
54 .D SAVE(.LINE)
55 .D CNTRL(.LINE,1,VALM("RM"),.IOINHI,.IOINORM)
56 I 'MODE D RESTORE(.LINE)
57 D WRITE(.LINE)
58 Q
59 ;
60WRITE(LINE) ; -- re-write line to screen
61 ; input: LINE := line number
62 ;
63 N DY
64 W IOSC
65 S DY=LINE-VALMBG+VALM("TM")-1 D IOXY^VALM4(0,.DY)
66 D WRITE^VALM4(.LINE,0,1,.DY)
67 W IORC
68 Q
69 ;
70FLDTEXT(LINE,FLD,TEXT) ; -- set text for field in line
71 ; input: LINE := line number
72 ; FLD := caption field name
73 ; TEXT := text to insert for field
74 ;
75 S @VALMAR@(LINE,0)=$$SETFLD^VALM1(.TEXT,@VALMAR@(LINE,0),.FLD)
76 Q
77 ;
78FLDCTRL(LINE,FLD,ON,OFF,SAVE) ; -- set default video ctrls for line
79 ; or just 1 field
80 ; input: LINE := line number
81 ; FLD := caption field name [optional]
82 ; ON := beginninng control code (ex. the value of IOINHI)
83 ; OFF := ending control code (ex. the value of IOINORM)
84 ; SAVE := 1 to save control code for later use
85 ; otherwise 0 [optional]
86 ;
87 I $G(FLD)="" D SWAP("^TMP(""VALM VIDEO SAVE"",$J,VALMEVL,0)","^TMP(""VALM VIDEO"",$J,VALMEVL,LINE)",1) G FLDCTRLQ
88 ; -- just a fld
89 N COL,WIDTH,X I '$D(ON) N ON,OFF
90 S X=VALMDDF(FLD),COL=$P(X,U,2),WIDTH=$P(X,U,3)
91 I '$D(ON) D
92 .S (ON,OFF)=""
93 .D ATRFLD^VALM00(.FLD,.ON,.OFF)
94 D:ON]"" CNTRL(LINE,COL,WIDTH,.ON,.OFF,$G(SAVE))
95FLDCTRLQ Q
96 ;
97SET(LINE,TEXT,ENTRY) ; -- set text in array
98 ; input: LINE := line number
99 ; TEXT := text for line
100 ; ENTRY := entry number assoicated with line [optional]
101 ; >> if defined, then line will also be indexed
102 ;
103 S @VALMAR@(LINE,0)=TEXT
104 S:$G(ENTRY) @VALMAR@("IDX",LINE,ENTRY)=""
105 Q
106 ;
107CLEAN ; -- kill off lines and video cntrls
108 K @VALMAR
109 K ^TMP("VALM VIDEO",$J,VALMEVL)
110 Q
111 ;
112MSG(VALMSG) ; -- post message immediately
113 I VALMCC D INSTR^VALM1(IORVON_$E($S(VALMSG]"":VALMSG,1:$$MSG^VALM())_$J("",50),1,50)_IORVOFF,11,VALM("BM")+1,50,0) S VALMSG="" G MSGQ
114 D LBAR^VALM
115MSGQ Q
Note: See TracBrowser for help on using the repository browser.