-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMainU.pas
70 lines (56 loc) · 1.47 KB
/
MainU.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
unit MainU;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,
Vcl.ExtCtrls;
type
TMainForm = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MainForm: TMainForm;
implementation
uses
OnlineOfflineU, OnlineTesterFormU;
{$R *.dfm}
procedure TMainForm.Button1Click(Sender: TObject);
var
i, j, VerticalCount, HorizontalCount: Integer;
begin
Button1.Enabled := False;
Top := 0;
Left := 0;
VerticalCount := (Screen.Height - 5) div 125;
HorizontalCount := (Screen.Width - Self.Width) div 345;
for i := 0 to VerticalCount - 1 do
for j := 0 to HorizontalCount - 1 do
with TOnlineTesterForm.Create(Self) do
begin
Left := (Self.Left + Self.Width) + (10 + j * 345);
Top := 5 + i * 125;
Show;
end;
Button2.SetFocus;
end;
procedure TMainForm.Button2Click(Sender: TObject);
begin
if OnlineOffline.OnlineState = TOnlineState.Offline then
OnlineOffline.OnlineState := TOnlineState.Online
else
OnlineOffline.OnlineState := TOnlineState.Offline;
end;
procedure TMainForm.Button3Click(Sender: TObject);
begin
OnlineOffline.ScanningInterval := 15;
end;
end.