unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  TrafficLight, StdCtrls, Spin;

type
  TForm1 = class(TForm)
    TrafficLight1: TTrafficLight;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
  TrafficLight1.Light := tlRed;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  TrafficLight1.Light := tlYellow;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  TrafficLight1.Light := tlGreen;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
  TrafficLight1.TimerEnabled := not TrafficLight1.TimerEnabled;
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
  TrafficLight1.TimerInterval := StrToInt(Edit1.Text);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Button5Click(nil);
end;

end.
