home *** CD-ROM | disk | FTP | other *** search
- unit DrawSqar;
-
- interface
- uses Crt, StrnU, ColorIU, FastWr;
- procedure DrawSquare( X1,
- Y1,
- X2,
- Y2, (* X & Y plus offsets *)
- Attr: byte;
- Fill: boolean);
-
- implementation
-
- procedure DrawSquare;
- var Lngth,
- I: integer;
- TopLine,
- BottomLine,
- TempLine: string;
- begin
- Lngth := abs(X2 - X1) + 1;
- TempLine := Strng(Lngth - 2, chr(205));
- TopLine := chr(201) + TempLine + chr(187);
- BottomLine := chr(200) + TempLine + chr(188);
- {$ifdef debug}
- delay(1000);
- {$endif}
- FastWrite(TopLine,Y1,X1,Attr);
- {$ifdef debug}
- delay(1000);
- {$endif}
- FastWrite(BottomLine,Y2,X1,Attr);
- {$ifdef debug}
- delay(1000);
- {$endif}
- for I := Y1+1 to Y2-1 do
- begin
- {$ifdef debug}
- delay(100);
- {$endif}
- FastWrite(chr(186),I,X1,Attr);
- FastWrite(chr(186),I,X2,Attr);
- end;
- if Fill then ColorIn( X1+1, Y1+1, X2-1, Y2-1, Attr);
- end;
-
- end.
-