1 | unit UFormAbout;
|
---|
2 |
|
---|
3 | {$mode delphi}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
|
---|
9 | StdCtrls, ExtCtrls, UApplicationInfo, UCommon, LCLIntf, UCoolTranslator;
|
---|
10 |
|
---|
11 | type
|
---|
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 | Translated: Boolean;
|
---|
28 | public
|
---|
29 | ApplicationInfo: TApplicationInfo;
|
---|
30 | CoolTranslator: TCoolTranslator;
|
---|
31 | end;
|
---|
32 |
|
---|
33 | var
|
---|
34 | FormAbout: TFormAbout;
|
---|
35 |
|
---|
36 | implementation
|
---|
37 |
|
---|
38 | {$R *.lfm}
|
---|
39 |
|
---|
40 | uses
|
---|
41 | UCore;
|
---|
42 |
|
---|
43 | resourcestring
|
---|
44 | SVersion = 'Version';
|
---|
45 | SReleaseDate = 'Release date';
|
---|
46 | SLicense = 'License';
|
---|
47 |
|
---|
48 | { TFormAbout }
|
---|
49 |
|
---|
50 | procedure TFormAbout.FormShow(Sender: TObject);
|
---|
51 | begin
|
---|
52 | if Assigned(CoolTranslator) and not Translated then begin
|
---|
53 | Translated := True;
|
---|
54 | CoolTranslator.TranslateComponentRecursive(Self);
|
---|
55 | end;
|
---|
56 | if Assigned(ApplicationInfo) then begin
|
---|
57 | LabelAppName.Caption := ApplicationInfo.AppName;
|
---|
58 | LabelAppName.AutoSize := True;
|
---|
59 | LabelAppName.Font.Size := 30;
|
---|
60 | LabelDescription.Caption := ApplicationInfo.Description;
|
---|
61 | LabelContent.Caption := SVersion + ': ' + ApplicationInfo.Version + LineEnding +
|
---|
62 | SReleaseDate + ': ' + DateToStr(ApplicationInfo.ReleaseDate) + LineEnding +
|
---|
63 | SLicense + ': ' + ApplicationInfo.License;
|
---|
64 | Image1.Picture.Bitmap.Assign(Application.Icon);
|
---|
65 | end;
|
---|
66 | end;
|
---|
67 |
|
---|
68 | procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
|
---|
69 | begin
|
---|
70 | if Assigned(ApplicationInfo) then
|
---|
71 | OpenURL(ApplicationInfo.HomePage);
|
---|
72 | end;
|
---|
73 |
|
---|
74 | procedure TFormAbout.FormCreate(Sender: TObject);
|
---|
75 | begin
|
---|
76 | Core.ThemeManager.UseTheme(Self);
|
---|
77 | ApplicationInfo := nil;
|
---|
78 | CoolTranslator := nil;
|
---|
79 | Translated := False;
|
---|
80 | end;
|
---|
81 |
|
---|
82 | end.
|
---|
83 |
|
---|