Program  HRG_Test_Programm;


(*$I A:HRG/TOOL.800*)

Procedure  Box_1 (x1, y1, x2, y2 : Integer);
Var        i : Integer;
Begin
  If x1 > x2 then Begin i := x1; x1 := x2; x2 := i End;
  If y1 > y2 then Begin i := y1; y1 := y2; y2 := i End;
  Box(x1, y1, x2, y2, 1);
  If (x2 - x1 > 2) and (y2 - y1 > 2)
   then Begin For i := x1+1 to x2-1 do Line(i, y1+1, x2+x1-i, y2-1, 4);
              For i := y1+2 to y2-2 do Line(x2-1, i, x1+1, y2+y1-i, 4)
        End
End;

Procedure  Box_2 (x1, y1, x2, y2 : Integer);
Var        i : Integer;
Begin
  If x1 > x2 then Begin i := x1; x1 := x2; x2 := i End;
  If y1 > y2 then Begin i := y1; y1 := y2; y2 := i End;
  Box(x1, y1, x2, y2, 1);
  If (x2-x1 > 2) and (y2-y1 > 2)
   then For i := x1+1 to x2-1 do
         Begin Line(x1+1, y2-1, i, y1+1, 4); Line(x2-1, y1+1, i, y2-1, 4) End
End;


Var mx, my, x, x1, x2, y, y1, y2, rx, ry, i, j : Integer;
    w, s : Real;
    t : Char;
Begin
  HRG_Tool_Init;
  Box(0, 0, 639, 191, 1); Box(4, 2, 635, 189, 1); Box(8, 4, 631, 187, 1);
  GotoXY(15, 3); Write('Grafik Demo unter Turbo Pascal mit HRG/TOOL.800 V2.1');
  GotoXY(15, 4); Write('Copyright (Juni.1986) by  Ralf Henning, West-Germany');
  Box(90, 10, 550, 37, 1); Box_1(50, 55, 150, 105); Box_1(50, 125, 150, 175);
  FillBox(40, 120, 160, 180, 4); Box_2(490, 55, 590, 105);
  Box_2(490, 125, 590, 175); FillBox(480, 50, 600, 110, 4);
  rx := 120; ry := 50; w := 0; s := 2; mx := 320; my := 115;
  Repeat x := mx + Round(Cos(pi * w / 180) * rx);
         y := my + Round(Sin(pi * w / 180) * ry);
         x1 := x + Round(s);     x2 := x - Round(s);
         y1 := y + Round(s/1.4); y2 := y - Round(s/1.4);
         Box(x1, y1, x2, y2, 1);
         w := w + s; s := s + 1.1
  Until  w > 400;
  rx := 70; ry := 10; w := 0; mx := 317; my :=119;
  Repeat x := mx + Round(Cos(pi * w / 180) * rx);
         y := my + Round(Sin(pi * w / 180) * ry);
         SetPkt(x, y, 1);
         w := w + 5
  Until w > 360;
  rx := 20; ry := 30; w := 0;
  Repeat x := mx + Round(Cos(pi * w / 180) * rx);
         y := my + Round(Sin(pi * w / 180) * ry);
         SetPkt(x, y, 1);
         w := w + 5
  Until w > 360;
(*  ScrLst; *)
  DeleteHRG(2, 0);
  SaveHRG(2, 0);
  Clear(4); ClrScr;
  GotoXY(15, 23); Write('Press <ESC> to continue ...');
  Repeat If KeyPressed then Read(Kbd, t) Until t = ^[;
  LoadHRG(2, 0);
  Repeat Until KeyPressed;
  Clear(4); ClrScr
End.
