1 unit AboutDialogU; 2 3 interface 4 5 uses 6 Buttons, Classes, Controls, Dialogs, ExtCtrls, Forms, Graphics, Messages, StdCtrls, SysUtils, Windows, 7 VersionInfo; 8 9 type 10 TAboutBox = class (TForm) 11 private // invisible outside of the unit 12 protected // visible in the unit and in descended classes 13 public // visible wherever the class can be referenced 14 published // like public, but generates RTTI info 15 lblCopyright: TLabel; 16 lblLicense: TLabel; 17 lblProductName: TLabel; 18 lblVersion: TLabel; 19 20 pnlInner: TPanel; 21 pnlOuter: TPanel; 22 ProgramIcon: TImage; 23 24 tmrAboutBox: TTimer; 25 26 procedure FormCreate (Sender: TObject); 27 procedure FormShow (Sender: TObject); 28 procedure tmrAboutBoxTimer (Sender: TObject); 29 end; 30 31 var 32 AboutBox: TAboutBox; 33 34 implementation 35 36 {$R *.DFM} 37 38 procedure TAboutBox.FormCreate (Sender: TObject); 39 var s: string; 40 begin 41 lblCopyright.Caption := GetVersionString ('LegalCopyright'); 42 lblLicense.Caption := GetVersionString ('License'); 43 lblProductName.Caption := GetVersionString ('ProductName'); 44 Caption := lblProductName.Caption; 45 lblVersion.Caption := lblVersion.Caption + GetFileVersion (TFileVersionLong); 46 47 ShortDateFormat := 'yyyy'; 48 s := DateToStr (Date); 49 if s <> Copy (lblCopyright.Caption, Length(lblCopyright.Caption)-3,4) then // year of original copyright 50 lblCopyright.Caption := lblCopyright.Caption + ', ' + s; 51 end; 52 53 procedure TAboutBox.FormShow (Sender: TObject); 54 begin 55 tmrAboutBox.Enabled := true; 56 end; 57 58 procedure TAboutBox.tmrAboutBoxTimer (Sender: TObject); 59 begin 60 tmrAboutBox.Enabled := false; 61 AboutBox.Visible := false; 62 end; 63 64 initialization 65 end. 66 67 68