{--------------------------------------------------------------------------- The control program for mass-spectrometer MI1201-AGM (c) Copyright Aleksandrov O.E., 2001 Molecular Physics department, USTU, Ekaterinsburg, K-2, 620002, RUSSIA phone 75-47-15 E-mail: aleks@dpt.ustu.ru Программа управления масс-спектрометром МИ1201-АГМ (c) Собственность Александрова О.Е., 2001 620002, Екатеринбург, К-2, УГТУ, Кафедра молекулярной физики тел. 75-47-15 E-mail: aleks@dpt.ustu.ru ----------------------------------------------------------------------------} unit MCAD_MI1201_FormABOUT; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, jpeg, MiscFunc; type TFormABOUT = class(TForm) ImageAbout: TImage; PanelBottom: TPanel; Title: TLabel; CopyRights: TLabel; ButtonOK: TButton; Version: TLabel; procedure ButtonOKClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormDestroy(Sender: TObject); procedure FormKeyPress(Sender: TObject; var Key: Char); private { Private declarations } public { Public declarations } Timer:tTimeInterval; end; var FormABOUT: TFormABOUT; procedure AboutShowEx(OK:boolean); procedure AboutShow; procedure AboutHide; procedure AboutClose; procedure AboutShowForTime(TimeOut:word); procedure AboutShowForTimeEx(TimeOut:word; OK:boolean); implementation USES xSystem; {$R *.DFM} procedure AboutShowEx(OK:boolean); begin if not Assigned(FormABOUT) then begin try FormABOUT:=TFormABOUT.Create(Application); except FormABOUT:=NIL; end; end; if Assigned(FormABOUT) then begin try FormABOUT.ButtonOk.Visible:=OK; FormABOUT.Show; {$IfDef DEBUG}FormABOUT.FormStyle:=fsNormal;{$EndIf} Application.ProcessMessages; FormABOUT.Timer.Start(0); except end; end; end; procedure AboutShow; begin AboutShowEx(TRUE); end; procedure AboutShowForTimeEx(TimeOut:word; OK:boolean); begin AboutShowEx(OK); if Assigned(FormABOUT) then begin FormABOUT.Timer.Start(TimeOut); end; end; procedure AboutShowForTime(TimeOut:word); begin AboutShowForTimeEx(TimeOut,TRUE); end; procedure AboutClose; begin if Assigned(FormABOUT) then begin try if FormABOUT.Visible and FormABOUT.Timer.NotIntervalEnd then Sleep(FormABOUT.Timer.TimeLeft); FreeAndNil(FormABOUT); except end; end; end; procedure AboutHide; begin if Assigned(FormABOUT) then begin try if FormABOUT.Visible and FormABOUT.Timer.NotIntervalEnd then Sleep(FormABOUT.Timer.TimeLeft); FormABOUT.Hide; except end; end; end; procedure TFormABOUT.ButtonOKClick(Sender: TObject); begin Close; end; procedure TFormABOUT.FormCreate(Sender: TObject); var Major,Minor:cardinal; begin if GetCurentExecutableVersion(Major,Minor) then begin Version.Caption:=Version.Caption+IntToStr(Major)+'.'+IntToStr(Minor); end else begin Version.Caption:=Version.Caption+'?'; end; end; procedure TFormABOUT.FormClose(Sender: TObject; var Action: TCloseAction); begin Action:=caFree; end; procedure TFormABOUT.FormDestroy(Sender: TObject); begin if FormABOUT=Self then FormABOUT:=NIL; end; procedure TFormABOUT.FormKeyPress(Sender: TObject; var Key: Char); begin case Key of #27: Close; end; end; end.