unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Buttons;
type
TForm1 =
class(TForm)
Shape12: TShape;
1.Brush.Color:=clmaroon;
A2.Brush.Color:=clyellow;
A3.Brush.Color:=clGreen;
B1.Brush.Color:=clmaroon;
B2.Brush.Color:=clyellow;
B3.Brush.Color:=clGreen;
zustand:='
ampelgelb';
timer1.enabled:=true;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if zustand='
ampelgruen'
then begin
ampel1.brush.color:=clred;
ampel2.brush.color:=clgreen;
ampel3.brush.color:=clred;
ampel4.brush.color:=clgreen;
A1.Brush.Color:=clmaroon;
A2.Brush.Color:=clolive;
A3.Brush.Color:=cllime;
B1.Brush.Color:=clmaroon;
B2.Brush.Color:=clolive;
B3.Brush.Color:=cllime;
zustand:='
ampelrot';
timer1.enabled:=false;
end;
if zustand='
aampelrot'
then begin
A1.Brush.Color:=clred;
A2.Brush.Color:=clolive;
B1.Brush.Color:=clred;
B2.Brush.Color:=clolive;
ampel1.brush.color:=clmaroon;
ampel2.brush.color:=cllime;
ampel3.brush.color:=clmaroon;
ampel4.brush.color:=cllime;
zustand:='
ampelrotgelb';
end;
if zustand='
ampelgelb'
then begin
A1.Brush.Color:=clred;
A2.Brush.Color:=clolive;
A3.Brush.Color:=clgreen;
B1.Brush.Color:=clred;
B2.Brush.Color:=clolive;
B3.Brush.Color:=clgreen;
ampel1.brush.color:=clmaroon;
ampel2.brush.color:=cllime;
ampel3.brush.color:=clmaroon;
ampel4.brush.color:=cllime;
zustand:='
aampelrot';
end;
if zustand='
ampelrotgelb'
then begin
ampel1.brush.color:=clred;
ampel2.brush.color:=clgreen;
ampel3.brush.color:=clred;
ampel4.brush.color:=clgreen;
A1.Brush.Color:=clred;
A2.Brush.Color:=clyellow;
A3.Brush.Color:=clgreen;
B1.Brush.Color:=clred;
B2.Brush.Color:=clyellow;
B3.Brush.Color:=clgreen;
zustand:='
ampelgruen';
end;
end;
procedure TForm1.IIClick(Sender: TObject);
begin
if zustand='
ampelrot'
then begin
A1.Brush.Color:=clmaroon;
A2.Brush.Color:=clyellow;
A3.Brush.Color:=clGreen;
B1.Brush.Color:=clmaroon;
B2.Brush.Color:=clyellow;
B3.Brush.Color:=clGreen;
zustand:='
ampelgelb';
timer1.enabled:=true;
end;
end;
end.