{<<<< DefineChars >>>>}
{ From: COMPLETE TURBO PASCAL by Jeff Duntemann  }
{ Scott, Foresman & Co. 1986  ISBN 0-673-18600-8 }
{ Described in section 14.1 -- Last mod 2/1/86   }
{ Requires prior definition of GrafRec--see file }
{ GRAFREC.DEF }

PROCEDURE DefineChars(VAR GrafChars : GrafRec);

BEGIN
  WITH GrafChars DO
    BEGIN
      ULCorner  := Chr(201);
      URCorner  := Chr(187);
      LLCorner  := Chr(200);
      LRCorner  := Chr(188);
      HBar      := Chr(205);
      VBar      := Chr(186);
      LineCross := Chr(206);
      TDown     := Chr(203);
      TUp       := Chr(202);
      TRight    := Chr(185);
      TLeft     := Chr(204)
    END
END;


{<<<< MakeBox >>>>}
{ From: COMPLETE TURBO PASCAL by Jeff Duntemann  }
{ Scott, Foresman & Co. 1986  ISBN 0-673-18600-8 }
{ Described in section 14.1 -- Last mod 2/1/86   }
{ Requires prior definition of GrafRec--see file }
{ GRAFREC.DEF }

PROCEDURE MakeBox(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(ULCorner);
      FOR I := 3 TO Width DO Write(HBar);
      Write(URCorner);
                                          { Draw bottom line }
      GotoXY(X,(Y+Height)-1); Write(LLCorner);
      FOR I := 3 TO Width DO Write(HBar);
      Write(LRCorner);
                                          { Draw sides }
      FOR I := 1 TO Height-2 DO
        BEGIN
          GotoXY(X,Y+I); Write(VBar);
          GotoXY((X+Width)-1,Y+I); Write(VBar)
        END
    END
END;
