unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TForm1 =
class(TForm)
pnHintergrund: TPanel;
btnSchaltung: TButton;
Panel1: TPanel;
Panel2: TPanel;
Timer1: TTimer;
pnGruen: TShape;
pnGelb: TShape;
pnRot: TShape;
procedure btnRotClick(Sender: TObject);
procedure btnGelbClick(Sender: TObject);
procedure btnGruenClick(Sender: TObject);
procedure btnGelb1Click(Sender: TObject);
procedure btnSchaltungClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.btnRotClick(Sender: TObject);
begin
pnRot.Brush.Color :=clred;
pnGelb.Brush.color := clblack;
pnGruen.Brush.color := clblack;
end;
procedure TForm1.btnGelbClick(Sender: TObject);
begin
pnGelb.Brush.color := clyellow;
pnGruen.Brush.color := clblack;
end;
procedure TForm1.btnGruenClick(Sender: TObject);
begin
pnGruen.Brush.color := clgreen;
pnRot.Brush.color := clblack;
pnGelb.Brush.color := clblack;
end;
procedure TForm1.btnGelb1Click(Sender: TObject);
begin
pnGelb.Brush.color := clyellow;
pnGruen.Brush.color := clNone;
end;
procedure TForm1.btnSchaltungClick(Sender: TObject);
begin if ((pnRot.Brush.color = clRed)
and (pnGelb.Brush.color = clBlack)
and (pnGruen.Brush.color = clBlack))
then begin
pnGelb.Brush.color := clyellow;
pnRot.Brush.color := clred;
pnGruen.Brush.color := clblack;
end
else
if ((pnRot.Brush.color = clred)
and (pnGelb.Brush.color = clyellow)
and (pnGruen.Brush.color = clblack))
then begin
pnGelb.Brush.color := clblack;
pnRot.Brush.color := clblack;
pnGruen.Brush.color := clgreen;
end
else
if ((pnRot.Brush.color = clblack)
and (pnGelb.Brush.color = clblack)
and (pnGruen.Brush.color = clgreen))
then begin pnGelb.Brush.color:=clyellow;
pnGruen.Brush.color:=clblack ;
pnRot.Brush.color:=clblack;
end
else
if ((pnRot.Brush.color = clblack)
and (pnGelb.Brush.color = clyellow)
and (pnGruen.Brush.color = clblack))
then begin
pnGelb.Brush.color := clblack;
pnRot.Brush.color := clred;
pnGruen.Brush.color := clblack;
end
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
btnSchaltung.Click
end;
end.