home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
PASCAL
/
MADTRB21.ZIP
/
BOXSTUFF.SRC
< prev
next >
Wrap
Text File
|
1985-06-09
|
2KB
|
65 lines
TYPE GRAFREC = RECORD
UL_CORNER,
UR_CORNER,
LL_CORNER,
LR_CORNER,
H_BAR,
V_BAR,
LINE_CROSS,
T_DOWN,
T_UP,
T_RIGHT,
T_LEFT : STRING[4]
END;
VAR GRAFCHARS : GRAFREC;
X,Y : INTEGER;
WIDTH,HEIGHT : INTEGER;
PROCEDURE DEFINE_CHARS(VAR GRAFCHARS : GRAFREC);
BEGIN
WITH GRAFCHARS DO
BEGIN
UL_CORNER := CHR(201);
UR_CORNER := CHR(187);
LL_CORNER := CHR(200);
LR_CORNER := CHR(188);
H_BAR := CHR(205);
V_BAR := CHR(186);
LINE_CROSS := CHR(206);
T_DOWN := CHR(203);
T_UP := CHR(202);
T_RIGHT := CHR(185);
T_LEFT := CHR(204)
END
END;
PROCEDURE MAKE_BOX(X,Y,WIDTH,HEIGHT : INTEGER;
GRAFCHARS : GRAFREC);
VAR I,J : INTEGER;
BEGIN
IF X < 0 THEN X := (80-WIDTH) DIV 2; { Negative X centers box }
WITH GRAFCHARS DO
BEGIN { Draw top line }
GOTOXY(X,Y); WRITE(UL_CORNER);
FOR I := 3 TO WIDTH DO WRITE(H_BAR);
WRITE(UR_CORNER);
{ Draw bottom line }
GOTOXY(X,(Y+HEIGHT)-1); WRITE(LL_CORNER);
FOR I := 3 TO WIDTH DO WRITE(H_BAR);
WRITE(LR_CORNER);
{ Draw sides }
FOR I := 1 TO HEIGHT-2 DO
BEGIN
GOTOXY(X,Y+I); WRITE(V_BAR);
GOTOXY((X+WIDTH)-1,Y+I); WRITE(V_BAR)
END
END
END;