-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabout.pas
134 lines (114 loc) · 3.42 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
unit about;
{$mode objfpc}{$H+}
interface
uses
{$IFDEF Windows} Win32Proc, {$ENDIF} FileInfo, SysUtils, Classes, Graphics,
Forms, Controls, StdCtrls, Buttons, ExtCtrls, LCLTranslator, LCLVersion,
LCLIntf;
const
VERSION = 'Dahlia';
type
{ TAboutBox }
TAboutBox = class (TForm)
Compiler: TLabel;
IDE: TLabel;
Comments: TLabel;
Donation: TImage;
Information: TLabel;
Platform: TLabel;
Website: TLabel;
VersionNumber: TLabel;
OperatingSystem: TLabel;
Panel1: TPanel;
ProgramIcon: TImage;
ProductName: TLabel;
Copyright: TLabel;
OKButton: TButton;
procedure FormShow(Sender: TObject);
procedure DonationClick(Sender: TObject);
procedure WebsiteClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
Str255 = string[255];
var
AboutBox: TAboutBox;
function OSVersion: Str255;
implementation
uses main;
{$R *.lfm}
resourcestring
strInformation = 'Informação do Sistema';
strComments = 'Sistema de Banco de Dados para Levantamentos Ecológicos de Campo.';
strWebsite = 'Página do ECOLOG na Internet';
strCompiler = 'Compilador:';
strPlatform = 'Plataforma:';
function OSVersion: Str255;
begin
{$IFDEF LCLcarbon}
OSVersion := 'Mac OS X 10.';
{$ELSE}
{$IFDEF Linux}
OSVersion := 'Linux Kernel ';
{$IFDEF CPU32}
OsVersion := OSVersion + ' (32-bits)';
{$ENDIF}
{$IFDEF CPU64}
OsVersion := OSVersion + ' (64-bits)';
{$ENDIF}
{$ELSE}
{$IFDEF UNIX}
OSVersion := 'Unix ';
{$ELSE}
{$IFDEF WINDOWS}
if WindowsVersion = wv95 then OSVersion := 'Windows 95 '
else if WindowsVersion = wvNT4 then OSVersion := 'Windows NT v.4 '
else if WindowsVersion = wv98 then OSVersion := 'Windows 98 '
else if WindowsVersion = wvMe then OSVersion := 'Windows ME '
else if WindowsVersion = wv2000 then OSVersion := 'Windows 2000 '
else if WindowsVersion = wvXP then OSVersion := 'Windows XP '
else if WindowsVersion = wvServer2003 then OSVersion := 'Windows Server 2003 '
else if WindowsVersion = wvVista then OSVersion := 'Windows Vista '
else if WindowsVersion = wv7 then OSVersion := 'Windows 7 '
else if WindowsVersion = wv8 then OSVersion := 'Windows 8 '
else if WindowsVersion = wv10 then OSVersion := 'Windows 10 '
else OSVersion:= 'Windows ';
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
end;
{ TAboutBox }
procedure TAboutBox.FormShow(Sender: TObject);
var
Quad: TVersionQuad;
begin
if GetProgramVersion(Quad) then
VersionNumber.Caption := 'v.' + VersionQuadToStr(Quad) + ' (' + DateToStr(Now) + ') -- "' + VERSION + '"';
Information.Caption := strInformation;
Comments.Caption := strComments;
Compiler.Caption := strCompiler + ' ' + Format('Free Pascal v.%s', [{$I %FPCVERSION%}]);
IDE.Caption := 'IDE: ' + Format('Lazarus v.%s', [lcl_version]);
Platform.Caption := strPlatform + ' ' + {$I %FPCTARGETOS%};
OperatingSystem.Caption := 'OS: ' + OSVersion;
Website.Caption := strWebsite;
end;
procedure TAboutBox.DonationClick(Sender: TObject);
var
sUrl: string;
begin
case sLang of
'en', 'es':
sUrl := 'https://www.paypal.com/donate?hosted_button_id=SM442YC8BTMKY';
'pt_br':
sUrl := 'https://www.paypal.com/donate?hosted_button_id=U4WEUX9S4CST2';
end;
OpenURL(sUrl);
end;
procedure TAboutBox.WebsiteClick(Sender: TObject);
begin
OpenURL('http://ecolog.sourceforge.net');
end;
end.