-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathAboutForm.pas
119 lines (96 loc) · 3.14 KB
/
AboutForm.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
unit AboutForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls,
InflatablesList_Manager;
type
TfAboutForm = class(TForm)
imgLogo: TImage;
lblTitle: TLabel;
lblTitleShadow: TLabel;
lblVersion: TLabel;
lblCompiler: TLabel;
lblCopyright: TLabel;
lblMail: TLabel;
procedure FormCreate(Sender: TObject);
procedure lblMailClick(Sender: TObject);
procedure lblMailMouseEnter(Sender: TObject);
procedure lblMailMouseLeave(Sender: TObject);
private
{ Private declarations }
fILManager: TILManager;
protected
procedure BuildForm;
public
{ Public declarations }
procedure Initialize(ILManager: TILManager);
procedure Finalize;
procedure ShowInfo;
end;
var
fAboutForm: TfAboutForm;
implementation
uses
WinFileInfo,
InflatablesList_Utils;
{$R *.dfm}
procedure TfAboutForm.BuildForm;
begin
with TWinFileInfo.Create(WFI_LS_LoadVersionInfo or WFI_LS_LoadFixedFileInfo or WFI_LS_DecodeFixedFileInfo) do
try
lblTitle.Caption := VersionInfoValues[VersionInfoTranslations[0].LanguageStr,'FileDescription'];
lblTitleShadow.Caption := lblTitle.Caption;
lblVersion.Caption := IL_Format('version %d.%d.%d (build #%d, %s)',
[VersionInfoFixedFileInfoDecoded.FileVersionMembers.Major,
VersionInfoFixedFileInfoDecoded.FileVersionMembers.Minor,
VersionInfoFixedFileInfoDecoded.FileVersionMembers.Release,
VersionInfoFixedFileInfoDecoded.FileVersionMembers.Build,
{$IFDEF Debug}'debug'{$ELSE}'release'{$ENDIF}]);
lblCompiler.Caption := IL_Format('compiled in %s %s',
[{$IFDEF FPC}'Lazarus/FPC'{$ELSE}'Delphi'{$ENDIF},
{$IFDEF x64}'64bit'{$ELSE}'32bit'{$ENDIF}]);
lblCopyright.Caption := IL_Format('%s, all rights reserved',
[VersionInfoValues[VersionInfoTranslations[0].LanguageStr,'LegalCopyright']]);
finally
Free;
end;
end;
//==============================================================================
procedure TfAboutForm.Initialize(ILManager: TILManager);
begin
fILManager := ILManager;
end;
//------------------------------------------------------------------------------
procedure TfAboutForm.Finalize;
begin
// nothing to do
end;
//------------------------------------------------------------------------------
procedure TfAboutForm.ShowInfo;
begin
ShowModal;
end;
//==============================================================================
procedure TfAboutForm.FormCreate(Sender: TObject);
begin
BuildForm;
end;
//------------------------------------------------------------------------------
procedure TfAboutForm.lblMailClick(Sender: TObject);
begin
IL_ShellOpen(Self.Handle,'mailto:' + lblMail.Caption);
end;
//------------------------------------------------------------------------------
procedure TfAboutForm.lblMailMouseEnter(Sender: TObject);
begin
lblMail.Font.Style := lblMail.Font.Style + [fsUnderline];
lblMail.Font.Color := clRed;
end;
//------------------------------------------------------------------------------
procedure TfAboutForm.lblMailMouseLeave(Sender: TObject);
begin
lblMail.Font.Style := lblMail.Font.Style - [fsUnderline];
lblMail.Font.Color := clBlue;
end;
end.