вот реализация схемы:
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
CheckBox1: TCheckBox;
Timer1: TTimer;
procedure CheckBox1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
const
arr: array [0..15] of Byte = (
1, 1, 1, 1,
3, 3,
4, 4, 4, 4,
0, 4, 0, 4,
2, 2
);
implementation
{$R *.dfm}
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
Label1.Visible:=False;
Label2.Visible:=False;
Label3.Visible:=False;
Tag:=0;
Timer1.Enabled:=CheckBox1.Checked;
if Timer1.Enabled then Timer1Timer(Timer1);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if Tag>=Length(arr) then Tag:=0;
Label1.Visible:=(arr[Tag] and 1)>0;
Label2.Visible:=(arr[Tag] and 2)>0;
Label3.Visible:=(arr[Tag] and 4)>0;
Tag:=Tag+1;
end;
end.
схема работы задается массивом arr (задает функцию цветов по времени):
0 разряд - красный цвет (десятичное 1)
1 разряд - желтый цвет (десятичное 2)
2 разряд - зеленый цвет (десятичное 4)
комбинируя разряды можно получить различные режимы: группировка цветов, мигание и т.д.
http://data.cod.ru/95350