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, UTranslator, UTheme;
|
---|
10 |
|
---|
11 | type
|
---|
12 | { TFormAbout }
|
---|
13 |
|
---|
14 | TFormAbout = class(TForm)
|
---|
15 | ButtonClose: TButton;
|
---|
16 | ButtonHomePage: TButton;
|
---|
17 | ImageLogo: TImage;
|
---|
18 | LabelAppName: TLabel;
|
---|
19 | LabelDescription: TLabel;
|
---|
20 | LabelContent: TLabel;
|
---|
21 | PanelTop: TPanel;
|
---|
22 | PanelButtons: TPanel;
|
---|
23 | procedure ButtonHomePageClick(Sender: TObject);
|
---|
24 | procedure FormCreate(Sender: TObject);
|
---|
25 | procedure FormShow(Sender: TObject);
|
---|
26 | private
|
---|
27 | { private declarations }
|
---|
28 | public
|
---|
29 | AboutDialog: TObject; //TAboutDialog
|
---|
30 | procedure UpdateInterface;
|
---|
31 | end;
|
---|
32 |
|
---|
33 |
|
---|
34 | implementation
|
---|
35 |
|
---|
36 | {$R *.lfm}
|
---|
37 |
|
---|
38 | uses
|
---|
39 | UAboutDialog;
|
---|
40 |
|
---|
41 | resourcestring
|
---|
42 | SVersion = 'Version';
|
---|
43 | SReleaseDate = 'Release date';
|
---|
44 | SLicense = 'License';
|
---|
45 |
|
---|
46 | { TFormAbout }
|
---|
47 |
|
---|
48 | procedure TFormAbout.FormShow(Sender: TObject);
|
---|
49 | begin
|
---|
50 | if Assigned(AboutDialog) then
|
---|
51 | with TAboutDialog(AboutDialog) do begin
|
---|
52 | if Assigned(CoolTranslator) then
|
---|
53 | CoolTranslator.TranslateComponentRecursive(Self);
|
---|
54 | if Assigned(ThemeManager) then
|
---|
55 | ThemeManager.UseTheme(Self);
|
---|
56 |
|
---|
57 | if Assigned(ApplicationInfo) then
|
---|
58 | with ApplicationInfo do begin
|
---|
59 | LabelAppName.Caption := AppName;
|
---|
60 | LabelContent.Caption := SVersion + ': ' + Version + LineEnding +
|
---|
61 | SReleaseDate + ': ' + DateToStr(ReleaseDate) + LineEnding +
|
---|
62 | SLicense + ': ' + License;
|
---|
63 | LabelDescription.Caption := Description;
|
---|
64 | ImageLogo.Picture.Bitmap.Assign(Icon);
|
---|
65 | end;
|
---|
66 | end;
|
---|
67 | UpdateInterface;
|
---|
68 | end;
|
---|
69 |
|
---|
70 | procedure TFormAbout.UpdateInterface;
|
---|
71 | begin
|
---|
72 | ButtonHomePage.Enabled := Assigned(AboutDialog) and
|
---|
73 | Assigned(TAboutDialog(AboutDialog).ApplicationInfo);
|
---|
74 | end;
|
---|
75 |
|
---|
76 | procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
|
---|
77 | begin
|
---|
78 | OpenWebPage(TAboutDialog(AboutDialog).ApplicationInfo.HomePage);
|
---|
79 | end;
|
---|
80 |
|
---|
81 | procedure TFormAbout.FormCreate(Sender: TObject);
|
---|
82 | begin
|
---|
83 | end;
|
---|
84 |
|
---|
85 | end.
|
---|
86 |
|
---|