unit unit1;
interface
uses
Winapi.Windows,
Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs,
Vcl.ExtCtrls,
Vcl.StdCtrls, rechteck;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
rechteck1 : TRect;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
//var TheRect: TRect;
begin
{TheRect := Rect(10,10,100,100);
paintbox1.Canvas.Brush.Color := clBlack;
paintbox1.Canvas.FrameRect(TheRect);}
rechteck1:=TRect.erzeugen(10, 10, 100, 100, clred, form1);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
rechteck1:=TRect.erzeugen(10, 10, 100, 100, clred, form1);
end;
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
rechteck1.anfassen;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
rechteck1.ziehen;
end;
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
rechteck1.loslassen;
end;
end.