type
TForm3 = class(TForm)
//[..]
private
procedure Ampelschalten(Zustand: Integer);
end;
//[..]
procedure TForm3.Ampelschalten(Zustand: Integer);{0=aus, 1=grün, 2=gelb, 3=rot}
begin
with Canvas do
begin
case Zustand of
0:begin
Brush.Color:=clBlack;
Ellipse(50,50,150,150);
Ellipse(50,175,150,275);
Ellipse(50,300,150,400);
end;
1:begin
Brush.Color:=clBlack;
Ellipse(50,50,150,150);
Ellipse(50,175,150,275);
Brush.Color:=clGreen;
Ellipse(50,300,150,400);
end;
2:begin
Brush.Color:=clBlack;
Ellipse(50,50,150,150);
Ellipse(50,300,150,400);
Brush.Color:=clYellow;
Ellipse(50,175,150,275);
end;
3:begin
Brush.Color:=clBlack;
Ellipse(50,175,150,275);
Ellipse(50,300,150,400);
Brush.Color:=clRed;
Ellipse(50,50,150,150);
end;
end;
end;
end;