forked from jaden/SnapTimer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
about.pas
76 lines (58 loc) · 1.46 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
unit About;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
ExtCtrls, StdCtrls, LCLIntf, Grids, Windows;
type
{ TAboutForm }
TAboutForm = class(TForm)
Button1: TButton;
Image1: TImage;
TitleLbl: TLabel;
TextLbl: TLabel;
UrlLbl: TLabel;
procedure Exit(Sender: TObject);
procedure FormKeyPress(Sender: TObject; var Key: char);
procedure GotoUrl(Sender: TObject);
procedure ShowAboutForm(Sender: TObject);
procedure CloseForm();
private
{ private declarations }
public
{ public declarations }
end;
var
AboutForm: TAboutForm;
implementation
{ TAboutForm }
const
URL = 'http://dan.hersam.com/software/snaptimer/';
procedure TAboutForm.ShowAboutForm(Sender: TObject);
const
VersionStr = {$I version.inc};
begin
TitleLbl.Caption := 'SnapTimer ' + VersionStr;
TextLbl.Caption := 'Snapmagic Software' + sLineBreak + 'Written by Dan Hersam';
UrlLbl.Caption := URL;
end;
procedure TAboutForm.FormKeyPress(Sender: TObject; var Key: char);
begin
if key = #27 then CloseForm();
end;
procedure TAboutForm.GotoUrl(Sender: TObject);
begin
// TODO Replace this with OpenURL when I'm using Lazarus 0.9.29.0
ShellExecute(0, 'open', PChar(TLabel(Sender).Caption), nil, nil, SW_SHOWNORMAL);
end;
procedure TAboutForm.Exit(Sender: TObject);
begin
CloseForm();
end;
procedure TAboutForm.CloseForm();
begin
Close;
end;
initialization
{$I about.lrs}
end.