-
Notifications
You must be signed in to change notification settings - Fork 0
/
uInfoForm.pas
135 lines (116 loc) · 3.25 KB
/
uInfoForm.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
unit uInfoForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, Buttons, StdCtrls, ComCtrls, ShellAPI, uFileVersion;
type
TInfoForm = class(TForm)
sBackground: TShape;
sbOk: TSpeedButton;
iLogo: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
LbleMail: TLabel;
LblWeb: TLabel;
LblVersion: TLabel;
Shape1: TShape;
Shape2: TShape;
Label5: TLabel;
Label6: TLabel;
Timer: TTimer;
pInfo: TPanel;
reLicense: TRichEdit;
reHistory: TRichEdit;
procedure sbOkClick(Sender: TObject);
procedure LbleMailMouseEnter(Sender: TObject);
procedure LbleMailMouseLeave(Sender: TObject);
procedure LblWebMouseEnter(Sender: TObject);
procedure LblWebMouseLeave(Sender: TObject);
procedure LblWebClick(Sender: TObject);
procedure LbleMailClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure TimerTimer(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
private
_CanClose: Boolean;
public
procedure ShowInfo;
procedure ShowSplash;
end;
implementation
{$R *.dfm}
procedure TInfoForm.sbOkClick(Sender: TObject);
begin
Close;
end;
procedure TInfoForm.LbleMailMouseEnter(Sender: TObject);
begin
LbleMail.Font.Color:= clBlue;
LbleMail.Font.Style:= [fsUnderline];
end;
procedure TInfoForm.LbleMailMouseLeave(Sender: TObject);
begin
LbleMail.Font.Color:= clBlack;
LbleMail.Font.Style:= [];
end;
procedure TInfoForm.LblWebMouseEnter(Sender: TObject);
begin
LblWeb.Font.Color:= clBlue;
LblWeb.Font.Style:= [fsUnderline];
end;
procedure TInfoForm.LblWebMouseLeave(Sender: TObject);
begin
LblWeb.Font.Color:= clBlack;
LblWeb.Font.Style:= [];
end;
procedure TInfoForm.LblWebClick(Sender: TObject);
begin
ShellExecute(Handle,'open','https://github.com/agebhar1/sim8008','','',SW_MAXIMIZE);
end;
procedure TInfoForm.LbleMailClick(Sender: TObject);
begin
ShellExecute(Handle,'open','mailto:[email protected]?subject=SIM8008 Version 2','','',SW_NORMAL);
end;
procedure TInfoForm.FormCreate(Sender: TObject);
var
Major, Minor: Word;
Release, Build: Word;
begin
Timer.Enabled:= false;
GetFileVersion(PChar(Application.ExeName),Major,Minor,Release,Build);
LblVersion.Caption:= 'Version '+IntToStr(Major)+'.'+IntToStr(Minor)+'.'+
IntToStr(Release)+'.'+IntToStr(Build);
end;
procedure TInfoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
CanClose:= _CanClose;
end;
procedure TInfoForm.TimerTimer(Sender: TObject);
begin
Timer.Enabled:= false;
_CanClose:= true;
Close;
end;
procedure TInfoForm.ShowInfo;
begin
AutoSize:= false;
pInfo.Visible:= true;
AutoSize:= true;
Top:= (Screen.DesktopHeight - Height) div 2;
Left:= (Screen.DesktopWidth - Width) div 2;
_CanClose:= true;
ShowModal;
end;
procedure TInfoForm.ShowSplash;
begin
AutoSize:= false;
pInfo.Visible:= false;
AutoSize:= true;
Top:= (Screen.DesktopHeight - Height) div 2;
Left:= (Screen.DesktopWidth - Width) div 2;
_CanClose:= false;
Timer.Enabled:= true;
ShowModal;
end;
end.