VALM00 ;MJK/ALB - List Manager (cont.);10:04 AM 7 Dec 1992
;;1;List Manager;;Aug 13, 1993
;
KEYS(PRTCL,KILL) ; -- set up default objects
N X,I,Y,NUM,CNT
K:$G(KILL) VALMKEY
I VALM("DEFS") D
.S VALMKEY(10001)=+$O(^ORD(101,"B","VALM NEXT SCREEN",0))_"^NEXT^10001"
.S VALMKEY(10002)=+$O(^ORD(101,"B","VALM PREVIOUS SCREEN",0))_"^PREV^10002"
.S VALMKEY(10003)=+$O(^ORD(101,"B","VALM QUIT",0))_"^QUIT^10003"
S VALMKEY=$G(VALMKEY)+0
G:PRTCL="" KEYSQ
S X=+$O(^ORD(101,"B",PRTCL,0)),(VALMKEY,I)=0,NUM=9999
F S I=$O(^ORD(101,X,10,I)) Q:'I S Y=$G(^(I,0)) I $P(Y,U,2)]"" D
.S:'$P(Y,U,3) $P(Y,U,3)=NUM,NUM=NUM-1
.S VALMKEY(+$P(Y,U,3))=$P(Y,U,1,3),VALMKEY=VALMKEY+1
S VALMKEY=VALMKEY_U_PRTCL
KEYSQ Q
;
ATR ; -- set default video ctrls
N FLD,COL,WIDTH,ON,OFF
S FLD=""
F S FLD=$O(VALMDDF(FLD)) Q:FLD="" D
.S (ON,OFF)="",X=VALMDDF(FLD),COL=+$P(X,U,2),WIDTH=+$P(X,U,3)
.D ATRFLD(.FLD,.ON,.OFF)
.D:ON]"" CNTRL^VALM10(0,.COL,.WIDTH,.ON,.OFF,1)
Q
;
ATRFLD(FLD,ON,OFF) ; -- get field video ctrls ; ON/OFF by reference only
N CTRL,M
S CTRL=$P(VALMDDF(FLD),U,5)
F M=1:1:$L(CTRL) D ONOFF($E(CTRL,M),.ON,.OFF)
ATRFLDQ Q
;
ONOFF(CTRL,ON,OFF) ; -- get video ctrls ; ON/OFF by reference only
N I
S I=$F("HRUB",CTRL) S:I I=I-1
S ON=ON_@($P("IOINHI^IORVON^IOUON^IOBON","^",I))
S OFF=OFF_@($P("IOINORM^IORVOFF^IOUOFF^IOBOFF","^",I))
Q
;
SETUP(NAME) ; -- on-the-fly list
D @NAME
S Y=1 F X="ARRAY" I '$D(VALM(X)) S Y=0 G SETUPQ
I $E(VALM("ARRAY"))'="" S VALM("ARRAY")=" "_VALM("ARRAY")
S VALM("IFN")=0
S:'$D(VALM("TM")) VALM("TM")=$S('$D(VALM("HDR")):2,1:5)
S:'$D(VALM("BM")) VALM("BM")=$S('$D(VALM("HDR")):16,1:14)
S:'$D(VALM("TYPE")) VALM("TYPE")=2 ; def to display
S:'$D(VALM("TITLE")) VALM("TITLE")="Standard List Display"
I '$G(VALM("MAX")) S VALM("MAX")=1
S:'$D(VALM("FIXED")) VALM("FIXED")=0
S:'$D(VALM("RM")) VALM("RM")=240
S:'$D(VALM("DEFS")) VALM("DEFS")=1
S:'$D(VALMCC) VALMCC=1
S:'$D(VALM("HIDDEN")) VALM("HIDDEN")="VALM HIDDEN ACTIONS"
SETUPQ Q Y
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVALM00 2040 printed Oct 16, 2024@18:10:45 Page 2
VALM00 ;MJK/ALB - List Manager (cont.);10:04 AM 7 Dec 1992
+1 ;;1;List Manager;;Aug 13, 1993
+2 ;
KEYS(PRTCL,KILL) ; -- set up default objects
+1 NEW X,I,Y,NUM,CNT
+2 if $GET(KILL)
KILL VALMKEY
+3 IF VALM("DEFS")
Begin DoDot:1
+4 SET VALMKEY(10001)=+$ORDER(^ORD(101,"B","VALM NEXT SCREEN",0))_"^NEXT^10001"
+5 SET VALMKEY(10002)=+$ORDER(^ORD(101,"B","VALM PREVIOUS SCREEN",0))_"^PREV^10002"
+6 SET VALMKEY(10003)=+$ORDER(^ORD(101,"B","VALM QUIT",0))_"^QUIT^10003"
End DoDot:1
+7 SET VALMKEY=$GET(VALMKEY)+0
+8 if PRTCL=""
GOTO KEYSQ
+9 SET X=+$ORDER(^ORD(101,"B",PRTCL,0))
SET (VALMKEY,I)=0
SET NUM=9999
+10 FOR
SET I=$ORDER(^ORD(101,X,10,I))
if 'I
QUIT
SET Y=$GET(^(I,0))
IF $PIECE(Y,U,2)]""
Begin DoDot:1
+11 if '$PIECE(Y,U,3)
SET $PIECE(Y,U,3)=NUM
SET NUM=NUM-1
+12 SET VALMKEY(+$PIECE(Y,U,3))=$PIECE(Y,U,1,3)
SET VALMKEY=VALMKEY+1
End DoDot:1
+13 SET VALMKEY=VALMKEY_U_PRTCL
KEYSQ QUIT
+1 ;
ATR ; -- set default video ctrls
+1 NEW FLD,COL,WIDTH,ON,OFF
+2 SET FLD=""
+3 FOR
SET FLD=$ORDER(VALMDDF(FLD))
if FLD=""
QUIT
Begin DoDot:1
+4 SET (ON,OFF)=""
SET X=VALMDDF(FLD)
SET COL=+$PIECE(X,U,2)
SET WIDTH=+$PIECE(X,U,3)
+5 DO ATRFLD(.FLD,.ON,.OFF)
+6 if ON]""
DO CNTRL^VALM10(0,.COL,.WIDTH,.ON,.OFF,1)
End DoDot:1
+7 QUIT
+8 ;
ATRFLD(FLD,ON,OFF) ; -- get field video ctrls ; ON/OFF by reference only
+1 NEW CTRL,M
+2 SET CTRL=$PIECE(VALMDDF(FLD),U,5)
+3 FOR M=1:1:$LENGTH(CTRL)
DO ONOFF($EXTRACT(CTRL,M),.ON,.OFF)
ATRFLDQ QUIT
+1 ;
ONOFF(CTRL,ON,OFF) ; -- get video ctrls ; ON/OFF by reference only
+1 NEW I
+2 SET I=$FIND("HRUB",CTRL)
if I
SET I=I-1
+3 SET ON=ON_@($PIECE("IOINHI^IORVON^IOUON^IOBON","^",I))
+4 SET OFF=OFF_@($PIECE("IOINORM^IORVOFF^IOUOFF^IOBOFF","^",I))
+5 QUIT
+6 ;
SETUP(NAME) ; -- on-the-fly list
+1 DO @NAME
+2 SET Y=1
FOR X="ARRAY"
IF '$DATA(VALM(X))
SET Y=0
GOTO SETUPQ
+3 IF $EXTRACT(VALM("ARRAY"))'=""
SET VALM("ARRAY")=" "_VALM("ARRAY")
+4 SET VALM("IFN")=0
+5 if '$DATA(VALM("TM"))
SET VALM("TM")=$SELECT('$DATA(VALM("HDR")):2,1:5)
+6 if '$DATA(VALM("BM"))
SET VALM("BM")=$SELECT('$DATA(VALM("HDR")):16,1:14)
+7 ; def to display
if '$DATA(VALM("TYPE"))
SET VALM("TYPE")=2
+8 if '$DATA(VALM("TITLE"))
SET VALM("TITLE")="Standard List Display"
+9 IF '$GET(VALM("MAX"))
SET VALM("MAX")=1
+10 if '$DATA(VALM("FIXED"))
SET VALM("FIXED")=0
+11 if '$DATA(VALM("RM"))
SET VALM("RM")=240
+12 if '$DATA(VALM("DEFS"))
SET VALM("DEFS")=1
+13 if '$DATA(VALMCC)
SET VALMCC=1
+14 if '$DATA(VALM("HIDDEN"))
SET VALM("HIDDEN")="VALM HIDDEN ACTIONS"
SETUPQ QUIT Y
+1 ;