procedure TMainForm.N20Click(Sender: TObject);
var
i,j:Integer;
FindOne:Boolean;
begin
FindOne:=False;
For i:=0 to MDIChildCount-1 do
For j:=0 to ChildFormNum-1 do
If MDIChildRen[i] is THYForm then
begin
FindOne:=True;
HYForm.Show;
Break;
end;
If not FindOne then
HYForm := THYForm.Create(Self);
end;
procedure TMainForm.N21Click(Sender: TObject);
var
i,j:integer;
FindOne:Boolean;
begin
FindOne:=False;
For i:=0 to MDIChildCount-1 do
For j:=0 to ChildFormNum-1 do
If MDIChildRen[i] is TKHFYForm then
begin
FindOne:=True;
KHFYForm.Show;
Break;
end;
If not FindOne then
KHFYForm := TKHFYForm.Create(Self);
end;
procedure TMainForm.Timer1Timer(Sender: TObject);
var
MyNow:Tdatetime;
Hour,Min,Sec,mSec:word;
vm,vs,vh:Real;
begin
MyNow:=Now;
DecodeTime(MyNow,Hour,Min,Sec,mSec);
vh:=Hour/12.0*2*pi;
vm:=Min/60.0*2*pi;
vs:=Sec/60.0*2*pi;
with MainForm.Image2.Canvas do
begin
if not FirstTime then begin
pen.Color:=clwhite;
Moveto(17,17);
Lineto(17+round(12*sin(vho)),17-round(12*cos(vho)));
Moveto(17,17);
Lineto(17+round(15*sin(vmo)),17-round(15*cos(vmo)));
Moveto(17,17);
Lineto(17+round(15*sin(vso)),17-round(15*cos(vso)));
end
else
FirstTime:=False;
Pen.Color:=clBlack ;
Moveto(17,17);
Lineto(17+round(12*sin(vh)),17-round(12*cos(vh)));
Moveto(17,17);
Lineto(17+round(15*sin(vm)),17-round(15*cos(vm)));
Moveto(17,17);
Lineto(17+round(15*sin(vs)),17-round(15*cos(vs)));
end;
vho:=vh;
vmo:=vm;
vso:=vs;
end;
procedure TMainForm.FlatButton10Click(Sender: TObject);
var
i,j:integer;
FindOne:Boolean;
begin
FindOne:=false;
For i:=0 to MDIChildCount-1 do
For j:=0 to ChildFormNum-1 do
If MDIChildRen[i] is TMonthForm then
begin
FindOne:=True;
MonthForm.Show;
Break;
end;
If not FindOne then
MonthForm:=TMonthForm.Create(self);