unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
TKreis =
class
x,y,d: Integer;
constructor create (xx,yy,dd: Integer);
procedure erscheinen;
procedure verschwinden;
end;
{ TForm1 }
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
Kreis: TKreis;
implementation
{$R *.lfm}
constructor TKreis.create (xx,yy,dd: Integer);
begin
Kreis.x:=xx;
Kreis.y:=yy;
Kreis.d:=dd;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Kreis.create(strtoint(Form1.edit1.text),strtoint(Form1.edit2.text),strtoint(Form1.edit3.text));
Kreis.erscheinen;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Kreis.verschwinden;
end;
procedure TKreis.verschwinden;
begin
Form1.refresh;
end;
procedure TKreis.erscheinen;
begin
Form1.refresh;
Form1.canvas.Ellipse(Kreis.x,Kreis.y,Kreis.x+Kreis.d,Kreis.y+Kreis.d);
end;
end.