-
Notifications
You must be signed in to change notification settings - Fork 1
/
About.pas
170 lines (156 loc) · 3.93 KB
/
About.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{*******************************************************}
{ }
{ "About", version 2.0 }
{ }
{ Copyright (c) 2006-2008 "Indomit Soft" }
{ }
{ Original code is About.pas }
{ Created: Komin Mikhail }
{ Last updated: 29.01.2006 }
{ Modifed: Komin Mikhail }
{ }
{*******************************************************}
{ }
{ Äàííûé ìîäóëü ñîäåðæèò ôîðìó "Î ïðîãðàììå..." }
{ }
{*******************************************************}
{
var
F: TAboutBox;
begin
F:=TAboutBox.MyCreate(Self);
try
F.ShowModal;
finally
F.Free;
end;
end;
}
unit About;
interface
Uses
System.SysUtils,
System.Types,
System.UITypes,
System.Classes,
System.Variants,
System.IniFiles,
Data.DB,
FMX.Types,
FMX.Controls,
FMX.Forms,
FMX.Dialogs,
FMX.Objects,
FMX.Menus,
FMX.Grid,
FMX.ExtCtrls,
FMX.ListBox,
FMX.TreeView,
FMX.Memo,
FMX.TabControl,
FMX.Layouts,
FMX.Edit,
FMX.Platform,
FMX.Bind.DBEngExt,
FMX.Bind.Editors,
FMX.Bind.DBLinks,
FMX.Bind.Navigator,
Data.Bind.EngExt,
Data.Bind.Components,
Data.Bind.DBScope,
Data.Bind.DBLinks,
Datasnap.DBClient,
Fmx.Bind.Grid,
System.Rtti,
System.Bindings.Outputs,
Data.Bind.Grid,
System.Actions,
FMX.ActnList,
Fmx.StdCtrls,
FMX.Header,
FMX.Graphics;
type
TAboutBox = class(TForm)
ActionList1: TActionList;
BrowseURL1: TBrowseURL;
Panel2: TPanel;
Bevel1: TPanel;
OKButton: TButton;
Panel1: TPanel;
lblVersion: TLabel;
lblAutorName: TLabel;
LinkSite: TLabel;
Image1: TImage;
BrowseURL2: TBrowseURL;
lbdbversion: TLabel;
JvPoweredByJVCL1: TJvPoweredByJVCL;
lbprojectwebsite: TLabel;
Label2: TLabel;
Label1: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
procedure FormShow(Sender: TObject);
procedure LinkSiteClick(Sender: TObject);
private
procedure InitializeCaptions;
{ Private declarations }
public
dbversion: string;
constructor MyCreate (AOwner: TComponent);
{ Public declarations }
end;
implementation
uses StrUtils, Functions, MyDataModule;
{$R *.FMX}
function GetFileVersion(FileName: string; var Major, Minor, Release, Build: Word): Boolean;
var
Size, Size2: DWORD;
Pt, Pt2: Pointer;
begin
Result:= False;
(*** Get version information size in exe ***)
Size:= GetFileVersionInfoSize(PChar(FileName),Size2);
(*** Make sure that version information are included in exe file ***)
if Size > 0 then
begin
GetMem(Pt, Size);
GetFileVersionInfo(PChar(FileName), 0, Size, Pt);
VerQueryValue(Pt, '\', Pt2, Size2);
with TVSFixedFileInfo(Pt2^) do
begin
Major:= HiWord(dwFileVersionMS);
Minor:= LoWord(dwFileVersionMS);
Release:= HiWord(dwFileVersionLS);
Build:= LoWord(dwFileVersionLS);
end;
FreeMem(Pt, Size);
Result:= True;
end;
end;
procedure TAboutBox.InitializeCaptions;
var
Major, Minor, Release, Build: Word;
begin
// îïðåäåëåíèå âåðñèè
if GetFileVersion(Application.ExeName, Major, Minor, Release, Build) then
lblVersion.Caption:= Format('Version %d.%d.%d.%d',[Major, Minor, Release, Build])
else
lblVersion.Caption:='';
end;
procedure TAboutBox.FormShow(Sender: TObject);
begin
InitializeCaptions;
lbdbversion.Caption := dbversion;
end;
procedure TAboutBox.LinkSiteClick(Sender: TObject);
begin
BrowseURL1.URL:='https://github.com/Faq/Truice';
BrowseURL1.Execute;
end;
constructor TAboutBox.MyCreate(AOwner: TComponent);
begin
inherited Create(AOwner);
end;
end.