unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Menus;
type
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedure DoChange(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
uses TestClass;
var
myClass : TMyclass;
//Programmstart
procedure TForm1.FormCreate(Sender: TObject);
begin
myClass := TMyclass.Create;
myClass.OnChange_Func := DoChange;
end;
procedure TForm1.DoChange;
begin
ShowMessage('
Status geändert');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
myClass.Timer.enabled :=
NOT myClass.Timer.enabled;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
myClass.Status :=
NOT myClass.Status
end;
end.