home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / EASYBOX.ZIP / EASYBOX.PAS
Encoding:
Pascal/Delphi Source File  |  1985-12-28  |  2.4 KB  |  68 lines

  1. Procedure DrawBox(StartPosIn, StartPosDown, LengthBox, WidthBox : Integer);
  2.  
  3. (* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *)
  4. (*   This procedure will draw a box on the screen.  It is good for framing  *)
  5. (* menus and such.  The input is four numeric values, the first two values  *)
  6. (* are the X, Y coordinates of the screen, the next two values are the      *)
  7. (* length and width of the box.                                             *)
  8. (*                                                                          *)
  9. (*                       Example DrawBox(10,5,60,15)                        *)
  10. (*                    10 = X coordinate of the screen.                      *)
  11. (*                     5 = Y coordinate of the screen.                      *)
  12. (*                    60 = Length of the box.                               *)
  13. (*                    15 = Width of the box.                                *)
  14. (*                                                                          *)
  15. (* Written by                                                               *)
  16. (*    Tony Tunison - 75106,2317                                             *)
  17. (*    Bill Cote    - 71256,402                                              *)
  18. (* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *)
  19.  
  20. Const
  21.   DoubleHorizontal = #205;
  22.   SingleHorizontal = #196;
  23.   SingleVertical   = #179;
  24.   CornerOne        = #213;
  25.   CornerTwo        = #184;
  26.   CornerThree      = #190;
  27.   CornerFour       = #212;
  28.  
  29. Var
  30.   Count : Integer;
  31.  
  32. Begin
  33.   GotoXY(StartPosIn, StartPosDown);
  34.  
  35.   For Count := 1 To LengthBox Do
  36.     Write(DoubleHorizontal);
  37.   Write(CornerTwo);
  38.  
  39.   For Count := 1 To WidthBox Do
  40.     Begin
  41.       GotoXY(StartPosIn + LengthBox, StartPosDown + Count);
  42.       Write(SingleVertical)
  43.     End;
  44.  
  45.   GotoXY(StartPosIn, StartPosDown + WidthBox);
  46.   For Count := 1 To LengthBox Do
  47.   Begin
  48.      Write(DoubleHorizontal)
  49.   End;
  50.   Write(CornerThree);
  51.  
  52.   For Count := 1 To WidthBox Do
  53.     Begin
  54.       GotoXY(StartPosIn, StartPosDown + Count);
  55.       Write(SingleVertical)
  56.     End;
  57.  
  58.   GotoXY(StartPosIn, StartPosDown);
  59.   Write(CornerOne);
  60.   For Count := 2 To WidthBox Do
  61.     Begin
  62.       GotoXY(StartPosIn, StartPosDown + Count);
  63.       Write(SingleVertical)
  64.     End;
  65.     GotoXY(StartPosIn, StartPosDown + Count);
  66.     Write(CornerFour)
  67. End;
  68.