Unit main;

Interface

Uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, StdCtrls,math,RadarEB;

{==============================================================================}
{                                }Type {                                       }
{==============================================================================}
  TForm1 = Class(TForm)
    Image1: TImage;
    cmdUp: TButton;
    cmdLeft: TButton;
    cmdRight: TButton;
    cmdDown: TButton;
    Procedure FormCreate(Sender: TObject);
    Procedure FormDestroy(Sender: TObject);
    Procedure cmdUpClick(Sender: TObject);
    Procedure cmdDownClick(Sender: TObject);
    Procedure cmdLeftClick(Sender: TObject);
    Procedure cmdRightClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  End;

{==============================================================================}
{                                }Var {                                        }
{==============================================================================}
  Form1: TForm1;
  Radar: TRadar;

{==============================================================================}
{                            }Implementation {                                 }
{==============================================================================}

{$R *.DFM}

Procedure TForm1.FormCreate(Sender: TObject);
Begin

  Radar := TRadar.Create(Image1);
  Radar.Echo := Point(150, 50);
End;

Procedure TForm1.FormDestroy(Sender: TObject);
Begin
  Radar.Destroy;
End;

Procedure TForm1.cmdUpClick(Sender: TObject);
Begin
  Radar.Echo.y := max(Radar.Echo.y - 10, 50);

End;

Procedure TForm1.cmdDownClick(Sender: TObject);
Begin
  Radar.Echo.y := min(Radar.Echo.y + 10, Image1.Height - 50);
End;

Procedure TForm1.cmdLeftClick(Sender: TObject);
Begin
  Radar.Echo.x := max(Radar.Echo.x - 10,50);
End;

Procedure TForm1.cmdRightClick(Sender: TObject);
Begin
  Radar.Echo.x := min(Radar.Echo.x + 10, Image1.Width - 50);
End;

End.

