-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathuMain.pas
More file actions
150 lines (130 loc) · 4.56 KB
/
uMain.pas
File metadata and controls
150 lines (130 loc) · 4.56 KB
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
unit uMain;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
System.Generics.Collections,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
FMX.Controls.Presentation, FMX.StdCtrls, FMX.Layouts, FireDAC.Stan.Intf,
FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS,
FireDAC.Phys.Intf, FireDAC.DApt.Intf, Data.DB, FireDAC.Comp.DataSet,
FireDAC.Comp.Client, FMX.Effects, FMX.Objects, FMX.ListBox, FMX.Edit,
System.ImageList, FMX.ImgList, FireDAC.Stan.StorageJSON;
type
TfMain = class(TForm)
VertScrollBox1: TVertScrollBox;
Rectangle1: TRectangle;
ShadowEffect1: TShadowEffect;
Rectangle2: TRectangle;
Label1: TLabel;
Rectangle3: TRectangle;
Rectangle4: TRectangle;
Rectangle5: TRectangle;
Rectangle6: TRectangle;
Rectangle7: TRectangle;
Icones: TImageList;
tabCadastro: TFDMemTable;
tabCadastroCodigo: TAutoIncField;
tabCadastroNome: TStringField;
tabCadastroRua: TStringField;
tabCadastroBairro: TStringField;
tabCadastroCidade: TStringField;
tabCadastroAtivo: TBooleanField;
Rectangle8: TRectangle;
tabCadastroDataCadastro: TDateField;
Rectangle9: TRectangle;
Label2: TLabel;
Label3: TLabel;
edtNome: TEdit;
Label4: TLabel;
edtCodigo: TEdit;
Label5: TLabel;
edtEndereco: TEdit;
FDStanStorageJSONLink1: TFDStanStorageJSONLink;
ckbAtivo: TCheckBox;
procedure Rectangle5Click(Sender: TObject);
procedure Rectangle4Click(Sender: TObject);
procedure Rectangle3Click(Sender: TObject);
procedure Rectangle6Click(Sender: TObject);
procedure Rectangle7Click(Sender: TObject);
procedure Label2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ListaCadastro;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
fMain: TfMain;
implementation
{$R *.fmx}
uses uLayouts.Utils;
procedure TfMain.FormClose(Sender: TObject; var Action: TCloseAction);
begin
tabCadastro.SaveToFile(GetCurrentDir+'\cadastro.json');
end;
procedure TfMain.FormCreate(Sender: TObject);
begin
if FileExists(GetCurrentDir+'\cadastro.json') then
tabCadastro.LoadFromFile(GetCurrentDir+'\cadastro.json')
else
tabCadastro.Open;
ListaCadastro;
end;
procedure TfMain.Label2Click(Sender: TObject);
begin
if tabCadastro.Locate('Codigo',edtCodigo.Text,[]) then
tabCadastro.Edit
else begin
tabCadastro.Append;
tabCadastroCodigo.AsString := edtCodigo.Text;
tabCadastroDataCadastro.AsDateTime := Date;
end;
tabCadastroAtivo.AsBoolean := ckbAtivo.IsChecked;
tabCadastroNome.AsString := edtNome.Text;
tabCadastroRua.AsString := edtEndereco.Text;
tabCadastro.Post;
ListaCadastro;
end;
procedure TfMain.ListaCadastro;
begin
VertScrollBox1.ClearAllObjects;
tabCadastro.First;
while not tabCadastro.Eof do begin
VertScrollBox1.SkypeCard(tabCadastroNome.AsString,
tabCadastroRua.AsString,
tabCadastroDataCadastro.AsDateTime,
tabCadastroCodigo.AsInteger,
tabCadastroAtivo.AsBoolean);
tabCadastro.Next;
end;
end;
procedure TfMain.Rectangle3Click(Sender: TObject);
begin
VertScrollBox1.GoogleCard('DELPHI CREATIVE - DASHBOARDS SEM COMPONENTES',
'8 de dez de 2018 - Vídeo enviado por Delphi Creative '+
'O GRÁFICO CIRCULAR - Gráfico tipo Pizza ou tipo Donuts? Tanto faz... Se inscreve no canal e ...',
'https://www.youtube.com/watch?v=CEKiEbw4vMo'
);
end;
procedure TfMain.Rectangle4Click(Sender: TObject);
begin
// VertScrollBox1.SkypeCard('Diego Cataneo','Online à 10 minutos', Date, 10,1 );
// VertScrollBox1.SkypeCard('Diego Cataneo','Offline', Date, 7,0 );
end;
procedure TfMain.Rectangle5Click(Sender: TObject);
begin
VertScrollBox1.StringCard('Diego Cataneo;Delphi Creative;Se inscreva no canal;[email protected]');
end;
procedure TfMain.Rectangle6Click(Sender: TObject);
begin
VertScrollBox1.ClearAllObjects;
end;
procedure TfMain.Rectangle7Click(Sender: TObject);
begin
Showmessage('Nó proximo vídeo vamos criar uma lista semelhante a do YouTube')
end;
initialization
ReportMemoryLeaksOnShutdown := True;
end.