source: tags/1.3.1/Packages/Common/UFormAbout.pas

Last change on this file was 423, checked in by chronos, 2 years ago
  • Modified: Do not use explicit mode delphi directive as it is already set in project.
  • Modified: Use UNIX instead of LINUX for conditional code to work also on FreeBSD.
File size: 1.9 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 FormCreate(Sender: TObject);
23 procedure FormShow(Sender: TObject);
24 private
25 { private declarations }
26 public
27 AboutDialog: TObject; //TAboutDialog
28 procedure UpdateInterface;
29 end;
30
31
32implementation
33
34{$R *.lfm}
35
36uses
37 UAboutDialog;
38
39resourcestring
40 SVersion = 'Version';
41 SReleaseDate = 'Release date';
42 SLicense = 'License';
43
44{ TFormAbout }
45
46procedure TFormAbout.FormShow(Sender: TObject);
47begin
48 if Assigned(AboutDialog) then
49 with TAboutDialog(AboutDialog) do begin
50 if Assigned(Translator) then
51 Translator.TranslateComponentRecursive(Self);
52 if Assigned(ThemeManager) then
53 ThemeManager.UseTheme(Self);
54
55 if Assigned(ApplicationInfo) then
56 with ApplicationInfo do begin
57 LabelAppName.Caption := AppName;
58 LabelContent.Caption := SVersion + ': ' + Version + LineEnding +
59 SReleaseDate + ': ' + DateToStr(ReleaseDate) + LineEnding +
60 SLicense + ': ' + License;
61 LabelDescription.Caption := Description;
62 ImageLogo.Picture.Bitmap.Assign(Icon);
63 end;
64 end;
65 UpdateInterface;
66end;
67
68procedure TFormAbout.UpdateInterface;
69begin
70 ButtonHomePage.Enabled := Assigned(AboutDialog) and
71 Assigned(TAboutDialog(AboutDialog).ApplicationInfo);
72end;
73
74procedure TFormAbout.ButtonHomePageClick(Sender: TObject);
75begin
76 OpenWebPage(TAboutDialog(AboutDialog).ApplicationInfo.HomePage);
77end;
78
79procedure TFormAbout.FormCreate(Sender: TObject);
80begin
81end;
82
83end.
84
Note: See TracBrowser for help on using the repository browser.