1 | unit FormAbout;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
|
---|
7 | StdCtrls, ExtCtrls, ApplicationInfo, Common, Translator, Theme;
|
---|
8 |
|
---|
9 | type
|
---|
10 | { TFormAbout }
|
---|
11 |
|
---|
12 | TFormAbout = class(TForm)
|
---|
13 | ButtonClose: TButton;
|
---|
14 | ButtonHomePage: TButton;
|
---|
15 | ImageLogo: TImage;
|
---|
16 | LabelAppName: TLabel;
|
---|
17 | LabelDescription: TLabel;
|
---|
18 | LabelContent: TLabel;
|
---|
19 | PanelTop: TPanel;
|
---|
20 | PanelButtons: TPanel;
|
---|
21 | procedure ButtonHomePageClick(Sender: TObject);
|
---|
22 | procedure FormShow(Sender: TObject);
|
---|
23 | public
|
---|
24 | AboutDialog: TObject; //TAboutDialog
|
---|
25 | procedure UpdateInterface;
|
---|
26 | end;
|
---|
27 |
|
---|
28 |
|
---|
29 | implementation
|
---|
30 |
|
---|
31 | {$R *.lfm}
|
---|
32 |
|
---|
33 | uses
|
---|
34 | AboutDialog;
|
---|
35 |
|
---|
36 | resourcestring
|
---|
37 | SVersion = 'Version';
|
---|
38 | SReleaseDate = 'Release date';
|
---|
39 | SLicense = 'License';
|
---|
40 |
|
---|
41 | { TFormAbout }
|
---|
42 |
|
---|
43 | procedure TFormAbout.FormShow(Sender: TObject);
|
---|
44 | begin
|
---|
45 | if Assigned(AboutDialog) then
|
---|
46 | with TAboutDialog(AboutDialog) do begin
|
---|
47 | if Assigned(Translator) then
|
---|
48 | Translator.TranslateComponentRecursive(Self);
|
---|
49 | if Assigned(ThemeManager) then
|
---|
50 | ThemeManager.UseTheme(Self);
|
---|
51 |
|
---|
52 | if Assigned(ApplicationInfo) then
|
---|
53 | with ApplicationInfo do begin
|
---|
54 | LabelAppName.Caption := AppName;
|
---|
55 | LabelContent.Caption := SVersion + ': ' + Version + LineEnding +
|
---|
56 | SReleaseDate + ': ' + DateToStr(ReleaseDate) + LineEnding +
|
---|
57 | SLicense + ': ' + License;
|
---|
58 | LabelDescription.Caption := Description;
|
---|
59 | ImageLogo.Picture.Bitmap.Assign(Icon);
|
---|
60 | end;
|
---|
61 | end;
|
---|
62 | UpdateInterface;
|
---|
63 | end;
|
---|
64 |
|
---|
65 | procedure TFormAbout.UpdateInterface;
|
---|
66 | begin
|
---|
67 | ButtonHomePage.Enabled := Assigned(AboutDialog) and
|
---|
68 | Assigned(TAboutDialog(AboutDialog).ApplicationInfo);
|
---|
69 | end;
|
---|
70 |
|
---|
71 | procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
|
---|
72 | begin
|
---|
73 | OpenWebPage(TAboutDialog(AboutDialog).ApplicationInfo.HomePage);
|
---|
74 | end;
|
---|
75 |
|
---|
76 | end.
|
---|