unit GraphicControl1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, mGeoForm, StdCtrls;
type
toval =
class(tgeoform)
private
public
x1,x2,y1,y2:integer;
zeichenflaeche:tform;
constructor Create(f:Tform);
reintroduce;
procedure paint();
override;
procedure MyMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftstate;x,y : integer);
override;
procedure MyMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
override;
procedure MyMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer) ;
override;
end;
implementation
constructor toval.Create(f:Tform);
begin
//inherited create(self);
x1:=50;
y1:=50;
x2:=150;
y2:=100;
zeichenflaeche:=f;
OnMouseDown := MyMouseDown;
OnMouseMove := MyMouseMove;
OnMouseUp := MyMouseup;
end;
procedure toval.MyMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer) ;
begin
// end;
end;
procedure toval.MyMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
end;
procedure toval.MyMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer) ;
begin
zeichenflaeche.Canvas.Ellipse(x1+40,y1+40,x2+40,y2+40);
end;
procedure toval.paint();
var vFuellfarbe,vRandfarbe : Tcolor;
begin
vFuellfarbe := self.Fuellfarbe;
vRandfarbe := self.Randfarbe;
zeichenflaeche.Canvas.Brush.Color := vFuellfarbe;
zeichenflaeche.Canvas.Pen.Color := vRandfarbe;
zeichenflaeche.Canvas.Pen.Width := 3;
zeichenflaeche.Canvas.Ellipse(x1,y1,x2,y2);
end;
end.