ORWCH ; SLC/KCM/SCM - GUI calls specific to CPRS Chart;01:34 PM 15 Dec 1997 [10:52 AM 13 JUN 2002]
;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,109,149**;Dec 17, 1997
SAVESIZ(ORERR,NAM,VAL) ; save the bounds for a particular control
; NAM=frmName or frmName.ctrlName VAL=left,top,width,height
D EN^XPAR(DUZ_";VA(200,","ORWCH BOUNDS",NAM,VAL,.ORERR)
Q
LOADSIZ(VAL,NAM) ; return the bounds for a particular control
I NAM="" S VAL="" Q
S VAL=$$GET^XPAR(DUZ_";VA(200,","ORWCH BOUNDS",NAM,"I")
Q
;
LDFONT(VAL,NAM) ; load the user's preferred font size
S VAL=$$GET^XPAR(DUZ_";VA(200,","ORWCH FONT SIZE",1,"I")
Q
SAVEALL(OK,LST) ; save the list of sizing information
N I,TYP,NAM,VAL,PAR,ORERR
S (I,OK)="" F S I=$O(LST(I)) Q:'I D
. S TYP=$P(LST(I),U),NAM=$P(LST(I),U,2),VAL=$P(LST(I),U,3)
. S PAR="ORWCH "_$S(TYP="B":"BOUNDS",TYP="W":"WIDTH",TYP="C":"COLUMNS")
. D EN^XPAR(DUZ_";VA(200,",PAR,NAM,VAL,.ORERR)
. I ORERR S OK=OK_LST(I)_":"_ORERR_U
; Other clean up: kill off global for sharing DFN
K ^TMP("ORWCHART",$J),^TMP("ORECALL",$J),^TMP("ORWORD",$J)
K ^TMP("ORWDXMQ",$J)
Q
SAVECOL(OK,COL) ;save report column sizing information
N NAM,VAL,ORERR
S OK="",NAM=$P(COL,"^"),VAL=$P(COL,"^",2)
D EN^XPAR(DUZ_";VA(200,","ORWCH COLUMNS REPORTS",NAM,VAL,.ORERR)
I ORERR S OK=COL_":"_ORERR
Q
LOADALL(LST) ; load all the sizing related paramters
N ORBOUNDS,ORWIDTHS,ORCOLMNS,ILST S ILST=0
D GETLST^XPAR(.ORBOUNDS,DUZ_";VA(200,","ORWCH BOUNDS")
D GETLST^XPAR(.ORWIDTHS,DUZ_";VA(200,","ORWCH WIDTH")
D GETLST^XPAR(.ORCOLMNS,DUZ_";VA(200,","ORWCH COLUMNS")
S ILST=ILST+1,LST(ILST)="~Bounds"
S I="" F S I=$O(ORBOUNDS(I)) Q:'I S ILST=ILST+1,LST(ILST)="i"_ORBOUNDS(I)
S ILST=ILST+1,LST(ILST)="~Widths"
S I="" F S I=$O(ORWIDTHS(I)) Q:'I S ILST=ILST+1,LST(ILST)="i"_ORWIDTHS(I)
S ILST=ILST+1,LST(ILST)="~Columns"
S I="" F S I=$O(ORCOLMNS(I)) Q:'I S ILST=ILST+1,LST(ILST)="i"_ORCOLMNS(I)
Q
SAVFONT(ORERR,VAL) ; save the user's preferred font size
D EN^XPAR(DUZ_";VA(200,","ORWCH FONT SIZE",1,VAL,.ORERR)
Q
;
CLRUSR ; clear size & position settings for user
; called from ORW CLEAR SIZES USER
N DIC,DIR,DIK,ORERR,ENT,Y
W !,"Clear GUI size & position settings for selected user -"
S DIC=200,DIC(0)="AEMQ" D ^DIC Q:Y<1
S ENT=+Y_";VA(200,"
S DIR(0)="Y",DIR("A")="Clear sizes for "_$P(Y,U,2),DIR("B")="YES"
D ^DIR Q:Y'=1
D NDEL^XPAR(ENT,"ORWCH BOUNDS",.ORERR) I ORERR W !,ORERR
D NDEL^XPAR(ENT,"ORWCH WIDTH",.ORERR) I ORERR W !,ORERR
D NDEL^XPAR(ENT,"ORWCH COLUMNS",.ORERR) I ORERR W !,ORERR
D DEL^XPAR(ENT,"ORWCH FONT SIZE",1,.ORERR) I ORERR W !,ORERR
W !,"Settings cleared."
Q ;
; -- are the following calls still used?
;
GETPOS(VAL) ; returns the position and size information for CPRSChart
; VAL=WindowState^Size^Position^PageSplit,PageSplit...
N I,ORX
S VAL=$$GET^XPAR(DUZ_";VA(200,","ORWCH MAINFORM STATE",1,"I")_U
S VAL=VAL_$$GET^XPAR(DUZ_";VA(200,","ORWCH MAINFORM SIZE",1,"I")_U
S VAL=VAL_$$GET^XPAR(DUZ_";VA(200,","ORWCH MAINFORM POSITION",1,"I")_U
D GETLST^XPAR(.ORX,DUZ_";VA(200,","ORWCH PAGE SPLIT","Q")
S ORX="",I=0 F S I=$O(ORX(I)) Q:'I S $P(ORX,",",+ORX(I))=$P(ORX(I),U,2)
S VAL=VAL_ORX
Q
SETPOS(OK,X) ; records window size and position info for the current user
; X=WindowState^Size^Position^PageSplit,PageSplit...
N I,X4,ORERR S OK=1
D EN^XPAR(DUZ_";VA(200,","ORWCH MAINFORM STATE",1,$P(X,U),.ORERR)
D EN^XPAR(DUZ_";VA(200,","ORWCH MAINFORM SIZE",1,$P(X,U,2),.ORERR)
D EN^XPAR(DUZ_";VA(200,","ORWCH MAINFORM POSITION",1,$P(X,U,3),.ORERR)
S X4=$P(X,U,4)
F I=1:1:$L(X4,",") I +$P(X4,",",I) D
. D EN^XPAR(DUZ_";VA(200,","ORWCH PAGE SPLIT",I,$P(X4,",",I),.ORERR)
Q
ORWCH ; SLC/KCM/SCM - GUI calls specific to CPRS Chart;01:34 PM 15 Dec 1997 [10:52 AM 13 JUN 2002]
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,109,149**;Dec 17, 1997
SAVESIZ(ORERR,NAM,VAL) ; save the bounds for a particular control
+1 ; NAM=frmName or frmName.ctrlName VAL=left,top,width,height
+2 DO EN^XPAR(DUZ_";VA(200,","ORWCH BOUNDS",NAM,VAL,.ORERR)
+3 QUIT
LOADSIZ(VAL,NAM) ; return the bounds for a particular control
+1 IF NAM=""
SET VAL=""
QUIT
+2 SET VAL=$$GET^XPAR(DUZ_";VA(200,","ORWCH BOUNDS",NAM,"I")
+3 QUIT
+4 ;
LDFONT(VAL,NAM) ; load the user's preferred font size
+1 SET VAL=$$GET^XPAR(DUZ_";VA(200,","ORWCH FONT SIZE",1,"I")
+2 QUIT
SAVEALL(OK,LST) ; save the list of sizing information
+1 NEW I,TYP,NAM,VAL,PAR,ORERR
+2 SET (I,OK)=""
FOR
SET I=$ORDER(LST(I))
IF 'I
QUIT
Begin DoDot:1
+3 SET TYP=$PIECE(LST(I),U)
SET NAM=$PIECE(LST(I),U,2)
SET VAL=$PIECE(LST(I),U,3)
+4 SET PAR="ORWCH "_$SELECT(TYP="B":"BOUNDS",TYP="W":"WIDTH",TYP="C":"COLUMNS")
+5 DO EN^XPAR(DUZ_";VA(200,",PAR,NAM,VAL,.ORERR)
+6 IF ORERR
SET OK=OK_LST(I)_":"_ORERR_U
End DoDot:1
+7 ; Other clean up: kill off global for sharing DFN
+8 KILL ^TMP("ORWCHART",$JOB),^TMP("ORECALL",$JOB),^TMP("ORWORD",$JOB)
+9 KILL ^TMP("ORWDXMQ",$JOB)
+10 QUIT
SAVECOL(OK,COL) ;save report column sizing information
+1 NEW NAM,VAL,ORERR
+2 SET OK=""
SET NAM=$PIECE(COL,"^")
SET VAL=$PIECE(COL,"^",2)
+3 DO EN^XPAR(DUZ_";VA(200,","ORWCH COLUMNS REPORTS",NAM,VAL,.ORERR)
+4 IF ORERR
SET OK=COL_":"_ORERR
+5 QUIT
LOADALL(LST) ; load all the sizing related paramters
+1 NEW ORBOUNDS,ORWIDTHS,ORCOLMNS,ILST
SET ILST=0
+2 DO GETLST^XPAR(.ORBOUNDS,DUZ_";VA(200,","ORWCH BOUNDS")
+3 DO GETLST^XPAR(.ORWIDTHS,DUZ_";VA(200,","ORWCH WIDTH")
+4 DO GETLST^XPAR(.ORCOLMNS,DUZ_";VA(200,","ORWCH COLUMNS")
+5 SET ILST=ILST+1
SET LST(ILST)="~Bounds"
+6 SET I=""
FOR
SET I=$ORDER(ORBOUNDS(I))
IF 'I
QUIT
SET ILST=ILST+1
SET LST(ILST)="i"_ORBOUNDS(I)
+7 SET ILST=ILST+1
SET LST(ILST)="~Widths"
+8 SET I=""
FOR
SET I=$ORDER(ORWIDTHS(I))
IF 'I
QUIT
SET ILST=ILST+1
SET LST(ILST)="i"_ORWIDTHS(I)
+9 SET ILST=ILST+1
SET LST(ILST)="~Columns"
+10 SET I=""
FOR
SET I=$ORDER(ORCOLMNS(I))
IF 'I
QUIT
SET ILST=ILST+1
SET LST(ILST)="i"_ORCOLMNS(I)
+11 QUIT
SAVFONT(ORERR,VAL) ; save the user's preferred font size
+1 DO EN^XPAR(DUZ_";VA(200,","ORWCH FONT SIZE",1,VAL,.ORERR)
+2 QUIT
+3 ;
CLRUSR ; clear size & position settings for user
+1 ; called from ORW CLEAR SIZES USER
+2 NEW DIC,DIR,DIK,ORERR,ENT,Y
+3 WRITE !,"Clear GUI size & position settings for selected user -"
+4 SET DIC=200
SET DIC(0)="AEMQ"
DO ^DIC
IF Y<1
QUIT
+5 SET ENT=+Y_";VA(200,"
+6 SET DIR(0)="Y"
SET DIR("A")="Clear sizes for "_$PIECE(Y,U,2)
SET DIR("B")="YES"
+7 DO ^DIR
IF Y'=1
QUIT
+8 DO NDEL^XPAR(ENT,"ORWCH BOUNDS",.ORERR)
IF ORERR
WRITE !,ORERR
+9 DO NDEL^XPAR(ENT,"ORWCH WIDTH",.ORERR)
IF ORERR
WRITE !,ORERR
+10 DO NDEL^XPAR(ENT,"ORWCH COLUMNS",.ORERR)
IF ORERR
WRITE !,ORERR
+11 DO DEL^XPAR(ENT,"ORWCH FONT SIZE",1,.ORERR)
IF ORERR
WRITE !,ORERR
+12 WRITE !,"Settings cleared."
+13 ;
QUIT
+14 ; -- are the following calls still used?
+15 ;
GETPOS(VAL) ; returns the position and size information for CPRSChart
+1 ; VAL=WindowState^Size^Position^PageSplit,PageSplit...
+2 NEW I,ORX
+3 SET VAL=$$GET^XPAR(DUZ_";VA(200,","ORWCH MAINFORM STATE",1,"I")_U
+4 SET VAL=VAL_$$GET^XPAR(DUZ_";VA(200,","ORWCH MAINFORM SIZE",1,"I")_U
+5 SET VAL=VAL_$$GET^XPAR(DUZ_";VA(200,","ORWCH MAINFORM POSITION",1,"I")_U
+6 DO GETLST^XPAR(.ORX,DUZ_";VA(200,","ORWCH PAGE SPLIT","Q")
+7 SET ORX=""
SET I=0
FOR
SET I=$ORDER(ORX(I))
IF 'I
QUIT
SET $PIECE(ORX,",",+ORX(I))=$PIECE(ORX(I),U,2)
+8 SET VAL=VAL_ORX
+9 QUIT
SETPOS(OK,X) ; records window size and position info for the current user
+1 ; X=WindowState^Size^Position^PageSplit,PageSplit...
+2 NEW I,X4,ORERR
SET OK=1
+3 DO EN^XPAR(DUZ_";VA(200,","ORWCH MAINFORM STATE",1,$PIECE(X,U),.ORERR)
+4 DO EN^XPAR(DUZ_";VA(200,","ORWCH MAINFORM SIZE",1,$PIECE(X,U,2),.ORERR)
+5 DO EN^XPAR(DUZ_";VA(200,","ORWCH MAINFORM POSITION",1,$PIECE(X,U,3),.ORERR)
+6 SET X4=$PIECE(X,U,4)
+7 FOR I=1:1:$LENGTH(X4,",")
IF +$PIECE(X4,",",I)
Begin DoDot:1
+8 DO EN^XPAR(DUZ_";VA(200,","ORWCH PAGE SPLIT",I,$PIECE(X4,",",I),.ORERR)
End DoDot:1
+9 QUIT