var
Form1: TForm1;
First, Mdown: Boolean;
ox, oy, ox1, oy1: Integer;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Mdown := false;
Canvas.Pen.Mode := pmNotXor;
Canvas.Pen.Color := clblack;
Canvas.Pen.Style :=psDot;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if Mdown then
begin
if not First then
begin
Canvas.moveto(ox, oy);
Canvas.LineTo(ox1, oy);
Canvas.moveto(ox, oy);
Canvas.LineTo(ox, oy1);
Canvas.moveto(ox1, oy1);
Canvas.LineTo(ox, oy1);
Canvas.moveto(ox1, oy1);
Canvas.LineTo(ox1, oy);
end;
Canvas.moveto(ox, oy);
Canvas.LineTo(x, oy);
Canvas.moveto(ox, oy);
Canvas.LineTo(ox, y);
Canvas.moveto(x, y);
Canvas.LineTo(ox, y);
Canvas.moveto(x, y);
Canvas.LineTo(x, oy);
OX1 := X;
OY1 := Y;
First := False;
end;
end;
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Mdown := true;
First := true;
OX := X;
OY := Y;
end;
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Mdown := false;
OX := 0;
OY := 0;
OX1 := 0;
OY1 := 0;
end;