source: trunk/Packages/Common/UFormAbout.pas

Last change on this file was 25, checked in by chronos, 21 months ago
  • Modified: CoolTranslator replaced by Common package.
  • Modified: Update common package.
File size: 1.7 KB
Line 
1unit UFormAbout;
2
3interface
4
5uses
6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
7 StdCtrls, ExtCtrls, UApplicationInfo, UCommon, UTranslator, UTheme;
8
9type
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
29implementation
30
31{$R *.lfm}
32
33uses
34 UAboutDialog;
35
36resourcestring
37 SVersion = 'Version';
38 SReleaseDate = 'Release date';
39 SLicense = 'License';
40
41{ TFormAbout }
42
43procedure TFormAbout.FormShow(Sender: TObject);
44begin
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;
63end;
64
65procedure TFormAbout.UpdateInterface;
66begin
67 ButtonHomePage.Enabled := Assigned(AboutDialog) and
68 Assigned(TAboutDialog(AboutDialog).ApplicationInfo);
69end;
70
71procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
72begin
73 OpenWebPage(TAboutDialog(AboutDialog).ApplicationInfo.HomePage);
74end;
75
76end.
77
Note: See TracBrowser for help on using the repository browser.