source: WorldVistAEHR/trunk/r/VA_FILEMAN-ARJT-DI-DD-DM-DT-%DT-%RCR/DDGLCBOX.m@ 1042

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

initial load of WorldVistAEHR

File size: 2.5 KB
Line 
1DDGLCBOX ;SFISC/MKO-COMBO BOX ;2:09 PM 26 Apr 1996
2 ;;22.0;VA FileMan;;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5CBOX(DDGLGLO,DDGLOUT,DDGLROW,DDGLCOL,DDGLHT,DDGLWD,DDGLSEL,DDGLFLG) ;
6 Q:$G(DDGLGLO)=""
7 ;
8 N DDGLCBOX,DDGLSEL,DDGLI,DDGLNC,DDGLEMAP,DDGLTERM,DDGLDONE
9 ;
10 ;Create list box and set up defaults
11 D INIT
12 ;
13 ;Save the # columns and selected text
14 S DDGLI=DDGLCBOX(DDGLCBOX,"SV")
15 S DDGLNC=$P(DDGLI,U,5)
16 S DDGLSEL=DDGLCBOX(DDGLCBOX,"ITEM",$P(DDGLI,U,6))
17 K DDGLI
18 ;
19 ;Write the brackets for the edit field
20 S DY=DDGLROW,DX=DDGLCOL X IOXY
21 W "["_$J("",DDGLNC)_"]"
22 ;
23 ;Read for the edit box
24 S DDGLEMAP(1)="EKDN^DDGLCBOX;KEYDOWN"
25 S DDGLEMAP(2)="EQUIT^DDGLCBOX;$C(27,27)"
26 S DDGLEMAP(3)="EQUIT^DDGLCBOX;F1_""Q"""
27 S DDGLEMAP(4)="EQUIT^DDGLCBOX;F1_""C"""
28 S DDGLEMAP(5)="EEXIT^DDGLCBOX;F1_""E"""
29 ;
30 F D Q:$G(DDGLDONE)
31 . D EN^DIR0(DDGLROW,DDGLCOL+1,DDGLNC,1,DDGLSEL,245,0,.DDGLEMAP,"KTW",.DDGLSEL,.DDGLTERM)
32 . I $P(DDGLTERM,U)="N" S DDGLDONE=1 Q
33 . I $P(DDGLTERM,U)="QUIT" S DDGLDONE=1 Q
34 . I $P(DDGLTERM,U)="TO" S DDGLDONE=1 Q
35 . ;
36 . D READ^DDGLBXA(.DDGLCBOX,.DDGLOUT)
37 . I DDGLOUT("C")'="TAB" S DDGLDONE=1 Q
38 . S DDGLSEL=DDGLOUT(0)
39 ;
40 ;Clear edit field and destroy list box
41 S DY=DDGLROW,DX=DDGLCOL X IOXY
42 W $J("",DDGLNC+2)
43 D DESTROY^DDGLBXA(DDGLCBOX,$G(DDGLFLG))
44 Q
45 ;
46EKDN ;
47 Q:"^UP^DOWN^RIGHT^LEFT^TAB^"[(U_Y_U)
48 ;
49 D E1^DIR01
50 S DIR0CH=""
51 Q:DIR0A=""
52 ;
53 N DDGLDX,DDGLDY
54 W $P(DDGLVID,DDGLDEL,10)
55 S DDGLDX=DX,DDGLDY=DY
56 ;
57 D UPDATE^DDGLBXA(.DDGLCBOX,DIR0A)
58 ;
59 W $P(DDGLVID,DDGLDEL,6)
60 S DX=DDGLDX,DY=DDGLDY
61 Q
62EQUIT ;
63 S DIR0QT="1^QUIT"
64 Q
65EEXIT ;
66 S DIR0QT="1^N"
67 Q
68LTAB ;
69 K DDGLOUT
70 S DDGLOUT=$O(@DDGLGLO@(DDGLSEL,"")),DDGLOUT(0)=DDGLSEL
71 S DDGLOUT("C")="TAB"
72 S DDGLQT=1
73 Q
74 ;
75LKDN ;
76 N DY,DX
77 S DY=DDGLROW-1,DX=DDGLCOL X IOXY
78 W DDGLSEL_$J("",DDGLNC-$L(DDGLSEL))
79 Q
80 ;
81INIT ;Set defaults and create list box
82 ;Returns: DDGLCBOX array
83 ;
84 D INIT^DDGLIB0()
85 ;
86 ;Set defaults for row and column
87 N DDGLMAP
88 I $G(DDGLROW,-1)<0 S DDGLROW=5
89 E I DDGLROW+4>IOSL S DDGLROW=IOSL-4
90 I $G(DDGLCOL,-1)<0 S DDGLCOL=5
91 E I DDGLCOL+6>IOM S DDGLCOL=IOM-6
92 ;
93 ;Check DDGLHT and DDGLWD
94 S DDGLHT=$S($D(DDGLHT)[0:7,DDGLHT<3:3,1:DDGLHT)
95 S:DDGLROW+DDGLHT+2>IOSL DDGLHT=IOSL-DDGLROW
96 ;
97 S DDGLWD=$S($D(DDGLWD)[0:14,DDGLWD<5:5,1:DDGLWD)
98 S:DDGLCOL+DDGLWD+2>IOM DDGLWD=IOM-DDGLCOL
99 ;
100 S DDGLMAP(1)="LTAB^DDGLCBOX;$C(9)"
101 S DDGLMAP(2)="LKDN^DDGLCBOX;KEYDOWN"
102 ;
103 D CREATE^DDGLBXA(DDGLGLO,.DDGLCBOX,DDGLROW+1,DDGLCOL+1,DDGLHT,DDGLWD,$G(DDGLSEL),.DDGLMAP)
104 Q
105 ;
Note: See TracBrowser for help on using the repository browser.