Информатика. Программирование в Delphi
159
y0:=r+30;
t:=Now;
ahr:=90-HourOf(t)*30-(MinuteOf(t) div 12)*6;
amin:=90-MinuteOf(t)*6;
asec:=90-SecondOf(t)*6;
Timer1.Interval:=1000;
Timer1.Enabled:=true;
end;
procedure Vector(x0,y0,a,l:integer);
var
x,y:integer;
begin
Form1.Canvas.MoveTo(x0,y0);
x:=round(x0+l*cos(a*gr));
y:=round(y0-l*sin(a*gr));
Form1.Canvas.LineTo(x,y);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
x,y:integer;
a:integer;
h:integer;
begin
Canvas.Brush.Style:=bsClear;
Canvas.Pen.Width:=1;
Canvas.Pen.Color:=clGreen;
Canvas.Font.Color:=clLime;
a:=60;
h:=1;
while a>-300 do
begin
x:=x0+round(r*cos(a*gr));
y:=y0-round(r*sin(a*gr));
if a mod 30 =0 then
begin
Canvas.Ellipse(x-2,y-2,x+2,y+2);
x:=x0+round((r+15)*cos(a*gr));
y:=y0-round((r+15)*sin(a*gr));
Canvas.TextOut(x-5,y-7,IntToStr(h));
inc(h);
end
else