unit ZoneViewForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Spin, ExtCtrls, Buttons, MainForm;

type
  TViewZoneFrm = class(TForm)
    procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure SpeedButton1Click(Sender: TObject);
    procedure SpeedButton3Click(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton4Click(Sender: TObject);
    procedure SpeedButton5Click(Sender: TObject);
    procedure SpeedButton6Click(Sender: TObject);

    procedure SpeedButton5MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure SpeedButton6MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure SpeedButton5MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure SpeedButton6MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  ViewZoneFrm: TViewZoneFrm;
  StartX, StartY:word;

implementation

{$R *.dfm}

procedure TViewZoneFrm.Panel1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
 StartX := x;
 StartY := y;
end;

procedure TViewZoneFrm.SpeedButton1Click(Sender: TObject);
begin
 VzY := VzY-10;
 MainFrm.UpdateSize;
 MainFrm.UpdateMap;
end;

procedure TViewZoneFrm.SpeedButton3Click(Sender: TObject);
begin
 VzX := VzX-10;
 MainFrm.UpdateSize;
 MainFrm.UpdateMap;
end;

procedure TViewZoneFrm.SpeedButton2Click(Sender: TObject);
begin
 VzX := VzX+10;
 MainFrm.UpdateSize;
 MainFrm.UpdateMap;
end;

procedure TViewZoneFrm.SpeedButton4Click(Sender: TObject);
begin
 VzY := VzY+10;
 MainFrm.UpdateSize;
 MainFrm.UpdateMap;
end;

procedure TViewZoneFrm.SpeedButton5Click(Sender: TObject);
begin
 PxPerMetre := PxPerMetre+1;
 MainFrm.UpdateSize;
 MainFrm.UpdateMap;
end;

procedure TViewZoneFrm.SpeedButton6Click(Sender: TObject);
begin
 PxPerMetre := Round(PxPerMetre);
 PxPerMetre := PxPerMetre-1;
 if PxPerMetre<1 then PxPerMetre := 1;
 MainFrm.UpdateSize;
 MainFrm.UpdateMap;
end;

{procedure TViewZoneFrm.SpeedButton1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 Timer1.Enabled := true;
end;

procedure TViewZoneFrm.SpeedButton1MouseUp(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 Timer1.Enabled := false;
end;

procedure TViewZoneFrm.SpeedButton2MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 Timer2.Enabled := true;
end;

procedure TViewZoneFrm.SpeedButton3MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 Timer3.Enabled := true;
end;

procedure TViewZoneFrm.SpeedButton4MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 Timer4.Enabled := true;
end;

procedure TViewZoneFrm.SpeedButton2MouseUp(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 Timer2.Enabled := false;
end;

procedure TViewZoneFrm.SpeedButton3MouseUp(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 Timer3.Enabled := false;
end;

procedure TViewZoneFrm.SpeedButton4MouseUp(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 Timer4.Enabled := false;
end;
}
procedure TViewZoneFrm.SpeedButton5MouseUp(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 Timer5.Enabled := false;
end;

procedure TViewZoneFrm.SpeedButton6MouseUp(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 Timer6.Enabled := false;
end;

procedure TViewZoneFrm.SpeedButton5MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 Timer5.Enabled := true;
end;

procedure TViewZoneFrm.SpeedButton6MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 Timer6.Enabled := true;
end;

procedure TViewZoneFrm.FormCreate(Sender: TObject);
begin
 ZoneView.Picture.Bitmap.Width := 100;
 ZoneView.Picture.Bitmap.Height := 100;
end;

end.
