source: tags/1.3.0/Forms/UFormAbout.pas

Last change on this file was 18, checked in by chronos, 5 years ago
  • Added: Application icon.
File size: 1.7 KB
Line 
1unit UFormAbout;
2
3{$mode delphi}
4
5interface
6
7uses
8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
9 StdCtrls, ExtCtrls, UApplicationInfo, UCommon, LCLIntf;
10
11type
12
13 { TFormAbout }
14
15 TFormAbout = class(TForm)
16 ButtonHomePage: TButton;
17 ButtonClose: TButton;
18 Image1: TImage;
19 LabelAppName: TLabel;
20 LabelDescription: TLabel;
21 LabelContent: TLabel;
22 Panel1: TPanel;
23 procedure ButtonHomePageClick(Sender: TObject);
24 procedure FormCreate(Sender: TObject);
25 procedure FormShow(Sender: TObject);
26 private
27 { private declarations }
28 public
29 ApplicationInfo: TApplicationInfo;
30 end;
31
32var
33 FormAbout: TFormAbout;
34
35implementation
36
37{$R *.lfm}
38
39uses
40 UCore;
41
42resourcestring
43 SVersion = 'Version';
44 SReleaseDate = 'Release date';
45 SLicense = 'License';
46
47{ TFormAbout }
48
49procedure TFormAbout.FormShow(Sender: TObject);
50begin
51 if Assigned(ApplicationInfo) then begin
52 LabelAppName.Caption := ApplicationInfo.AppName;
53 LabelDescription.Caption := ApplicationInfo.Description;
54 LabelDescription.AutoSize := True;
55 LabelContent.Caption := SVersion + ': ' + ApplicationInfo.Version + LineEnding +
56 SReleaseDate + ': ' + DateToStr(ApplicationInfo.ReleaseDate) + LineEnding +
57 SLicense + ': ' + ApplicationInfo.License;
58 Image1.Picture.Bitmap.SetSize(Application.Icon.Width, Application.Icon.Height);
59 Image1.Picture.Bitmap.Assign(Application.Icon);
60 end;
61end;
62
63procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
64begin
65 if Assigned(ApplicationInfo) then
66 OpenURL(ApplicationInfo.HomePage);
67end;
68
69procedure TFormAbout.FormCreate(Sender: TObject);
70begin
71 Core.Translator1.TranslateComponentRecursive(Self);
72 Core.ThemeManager1.UseTheme(Self);
73end;
74
75end.
76
Note: See TracBrowser for help on using the repository browser.