unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, ComCtrls, Menus;

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    Image1: TImage;
    Label1: TLabel;
    Button1: TButton;
    Button2: TButton;
    Label2: TLabel;
    Timer1: TTimer;
    Label3: TLabel;
    ComboBoxEx1: TComboBoxEx;
    Label4: TLabel;
    ComboBoxEx2: TComboBoxEx;
    ColorDialog1: TColorDialog;
    ColorDialog2: TColorDialog;
    Button3: TButton;
    Button4: TButton;
    MainMenu1: TMainMenu;
    N1: TMenuItem;
    N2: TMenuItem;
    N3: TMenuItem;
    N4: TMenuItem;
    N5: TMenuItem;
    N6: TMenuItem;
    N7: TMenuItem;
    N8: TMenuItem;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure N4Click(Sender: TObject);
    procedure N5Click(Sender: TObject);
    procedure N6Click(Sender: TObject);
    procedure N7Click(Sender: TObject);
    procedure N8Click(Sender: TObject);
    procedure N3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

Const
n=1000;
var
   Form1: TForm1;
 xx, yy,k,dob,dob1,cl,cl2,tl,i,rt,p,o:integer;
move:boolean;
   masX:array [1..n] of integer;
  masy:array [1..n] of integer;

implementation

uses Unit2;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
dob:=dob+1;
dob1:=dob1+1;
masX[dob]:=400;
masY[dob]:=100;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
dob:=dob-1;
dob1:=dob1-1;
masX[dob1]:=xx+500;
masY[dob1]:=yy+300;
if dob=0 then
dob:=1;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
image1.Canvas.Brush.Color:=cl2;
image1.Canvas.Pen.Color:=cl2;
image1.Canvas.Brush.Color:=cl2;
image1.Canvas.Rectangle(0,0,1000,1000);
for i:=1 to dob do begin
k:=StrToInt(ComboBoxEx1.Text);//масштаб
if k<1 then k:=1;
tl:=StrToInt(ComboBoxEx2.Text);
image1.Canvas.Pen.Width:=tl;//толщина линии
image1.Canvas.Pen.Color:=cl;// цвет объекта
image1.canvas.TextOut(masX[i]+50*k,masY[i]-30*k,inttostr(i));//рисование объекта

image1.Canvas.MoveTo(masX[i]+20*k,masY[i]-1*k);
image1.Canvas.LineTo(masX[i]+180*k,masY[i]-1*k);
image1.Canvas.MoveTo(masX[i]+60*k,masY[i]+30*k);
image1.Canvas.LineTo(masX[i]+60*k,masY[i]-30*k);
image1.Canvas.LineTo(masX[i]+105*k,masY[i]-1*k);
image1.Canvas.LineTo(masX[i]+60*k,masY[i]+30*k);
image1.Canvas.MoveTo(masX[i]+105*k,masY[i]+30*k);
image1.Canvas.LineTo(masX[i]+105*k,masY[i]-30*k);
image1.Canvas.MoveTo(masX[i]+105*k,masY[i]+30*k);
image1.Canvas.lineTo(masX[i]+155*k,masY[i]+40*k);

image1.canvas.TextOut(masX[i]+30*k,masY[i]-30*k,'VD');
end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
cl2:=clwhite;
dob:=1;
dob1:=1;
masX[dob]:=100;
masY[dob]:=100;

end;

procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
If Shift=[ssLeft] then begin
o:=x;
p:=y;
masX[dob] := x;
masY[dob] := y;
end;
if rt>0 then begin
If Shift=[ssLeft] then begin
  masX[rt]:=x;
  masY[rt]:=y;
  end;
  end;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
Colordialog1.Execute;              //цвет объекта
Canvas.Pen.Color:=colordialog1.Color;
cl:=colordialog1.Color;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
Colordialog2.Execute;               //цвет канвы
Canvas.Pen.Color:=colordialog2.Color;
cl2:=colordialog2.Color;
end;

procedure TForm1.N4Click(Sender: TObject);
begin
close
end;

procedure TForm1.N5Click(Sender: TObject);
begin
dob:=dob+1;
dob1:=dob1+1;
masX[dob]:=400;
masY[dob]:=100;
end;

procedure TForm1.N6Click(Sender: TObject);
begin
dob:=dob-1;
dob1:=dob1-1;
masX[dob1]:=xx+500;
masY[dob1]:=yy+300;
end;

procedure TForm1.N7Click(Sender: TObject);
begin
Colordialog1.Execute;              //цвет объекта
Canvas.Pen.Color:=colordialog1.Color;
cl:=colordialog1.Color;
end;

procedure TForm1.N8Click(Sender: TObject);
begin
Colordialog2.Execute;               //цвет канвы
Canvas.Pen.Color:=colordialog2.Color;
cl2:=colordialog2.Color;
end;

procedure TForm1.N3Click(Sender: TObject);
begin
form2.show; //титульник
end;

end.
