-
Notifications
You must be signed in to change notification settings - Fork 1
/
ultk.pas
154 lines (125 loc) · 3.72 KB
/
ultk.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
unit uLtk;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
StdCtrls, ComCtrls, SynHighlighterHTML, IdFTP,
uLotofacil_database;
type
{ TForm1 }
TForm1 = class(TForm)
btnGerador_combinatorio: TButton;
btnGerador_combinatorio1: TButton;
Button1: TButton;
Button2: TButton;
btnGerador_Permutacao: TButton;
btnAtualizar_Intralot: TButton;
Button3 : TButton;
Button4 : TButton;
IdFTP1: TIdFTP;
StatusBar1 : TStatusBar;
procedure btnAtualizar_IntralotClick(Sender: TObject);
procedure btnGerador_combinatorio1Click(Sender: TObject);
procedure btnGerador_combinatorioClick(Sender: TObject);
procedure btnGerador_Permutacao1Click(Sender: TObject);
procedure btnGerador_PermutacaoClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender : TObject);
procedure Button4Click(Sender : TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
private
{ private declarations }
ltfDatabase: TLotofacilDatabase;
procedure lotofacilThreadStatus(qtGerados: LongInt);
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
uses uAtualizar, uGerador_Permutacao, uintralot_extrator, uLotofacilGerador,
uGerador_Combinatorio, uGerador_Aleatorio;
var
frmGerador_Permutacao: TFrmGerador_Permutacao;
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
frmAtualizar.ShowModal;
MessageDlg('TEste', TMsgDlgType.mtConfirmation, [mbOK], 0);
end;
procedure TForm1.btnGerador_PermutacaoClick(Sender: TObject);
begin
if not Assigned(frmGerador_Permutacao) then
begin
frmGerador_Permutacao := TFrmGerador_Permutacao.Create(TComponent(Sender));
end;
frmGerador_Permutacao.ShowModal;
end;
procedure TForm1.btnAtualizar_IntralotClick(Sender: TObject);
var
frmIntralot_Extrator: TfrmIntralot_Extrator;
begin
frmIntralot_Extrator := TFrmIntralot_Extrator.Create(TComponent(Sender));
if Assigned(frmIntralot_Extrator) then
begin
frmIntralot_Extrator.ShowModal;
frmIntralot_Extrator.FreeOnRelease;
end;
end;
procedure TForm1.btnGerador_combinatorio1Click(Sender: TObject);
begin
frmGerador_Aleatorio := TFrmGerador_Aleatorio.Create(TComponent(Sender));
frmGerador_Aleatorio.ShowModal;
if Assigned(frmGerador_Aleatorio) then
frmGerador_Aleatorio.Free;
end;
procedure TForm1.btnGerador_combinatorioClick(Sender: TObject);
var
frmGerador_Combinatorio: TFrmGerador_combinatorio;
begin
frmGerador_Combinatorio := TFrmGerador_Combinatorio.Create(TComponent(Sender));
if Assigned(frmGerador_Combinatorio) then
begin
frmGerador_Combinatorio.ShowModal;
frmGerador_Combinatorio.FreeOnRelease;
end;
end;
procedure TForm1.btnGerador_Permutacao1Click(Sender: TObject);
begin
end;
procedure TForm1.Button2Click(Sender: TObject);
var
jogoLotofacil: TLotofacil;
begin
jogoLotofacil := TLotofacil.Create;
jogoLotofacil.Gerar15Numeros;
end;
procedure TForm1.Button3Click(Sender : TObject);
begin
if ltfDatabase = nil then begin
ltfDatabase := TLotofacilDatabase.Create;
end;
ltfDatabase.onStatus := @self.lotofacilThreadStatus;
ltfDatabase.GerarLotofacil15Numeros;
end;
procedure TForm1.Button4Click(Sender : TObject);
begin
if ltfDatabase = nil then begin
ltfDatabase := TLotofacilDatabase.Create;
end;
ltfDatabase.GerarSubConjuntos;
end;
procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
if Assigned(FrmAtualizar) then
begin
frmAtualizar.Free;
end;
end;
procedure TForm1.lotofacilThreadStatus(qtGerados : LongInt);
begin
statusBar1.Panels[0].Text := IntToStr(qtGerados);
end;
end.