home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / mailpro / drawsqar.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-08-23  |  1.0 KB  |  48 lines

  1. unit DrawSqar;
  2.  
  3. interface
  4. uses Crt, StrnU, ColorIU, FastWr;
  5. procedure DrawSquare( X1,
  6.                       Y1,
  7.                       X2,
  8.                       Y2,                  (* X & Y plus offsets *)
  9.                       Attr:     byte;
  10.                       Fill:     boolean);
  11.  
  12. implementation
  13.  
  14. procedure DrawSquare;
  15. var Lngth,
  16.     I:                          integer;
  17.     TopLine,
  18.     BottomLine,
  19.     TempLine:                   string;
  20. begin
  21. Lngth := abs(X2 - X1) + 1;
  22. TempLine := Strng(Lngth - 2, chr(205));
  23. TopLine :=  chr(201) + TempLine + chr(187);
  24. BottomLine := chr(200) + TempLine + chr(188);
  25. {$ifdef debug}
  26. delay(1000);
  27. {$endif}
  28. FastWrite(TopLine,Y1,X1,Attr);
  29. {$ifdef debug}
  30. delay(1000);
  31. {$endif}
  32. FastWrite(BottomLine,Y2,X1,Attr);
  33. {$ifdef debug}
  34. delay(1000);
  35. {$endif}
  36. for I := Y1+1 to Y2-1 do
  37.     begin
  38. {$ifdef debug}
  39. delay(100);
  40. {$endif}
  41.     FastWrite(chr(186),I,X1,Attr);
  42.     FastWrite(chr(186),I,X2,Attr);
  43.     end;
  44. if Fill then ColorIn( X1+1, Y1+1, X2-1, Y2-1, Attr);
  45. end;
  46.  
  47. end.
  48.