-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuDesign.pas
More file actions
404 lines (358 loc) · 10.4 KB
/
uDesign.pas
File metadata and controls
404 lines (358 loc) · 10.4 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
unit uDesign;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Ani, FMX.Objects, System.Skia,
FMX.Skia, FMX.Effects, FMX.Controls.Presentation, FMX.StdCtrls, FMX.Layouts, FMX.Edit, FMX.ListBox,
Alcinoe.FMX.StdCtrls, FMX.MultiView, Alcinoe.FMX.Objects, Alcinoe.FMX.Ani, Alcinoe.FMX.Edit,
FMX.Colors, uFEditText, uFButton;
type
TFormDesign = class(TForm)
RectBut: TRectangle;
CoAni: TColorAnimation;
SkLText: TSkLabel;
ShadEff: TShadowEffect;
FloAni: TFloatAnimation;
SkAnimatedImage1: TSkAnimatedImage;
SkSvg1: TSkSvg;
GlowEffect1: TGlowEffect;
LayoutButton: TLayout;
LayoutEditCustom: TLayout;
LayoutComboBox: TLayout;
Rectangle1: TRectangle;
SkSvgAlert2: TSkSvg;
ShadowEffect1: TShadowEffect;
Layout3: TLayout;
Layout6: TLayout;
Rectangle2: TRectangle;
SkLabel1: TSkLabel;
Layout7: TLayout;
SkSvg5: TSkSvg;
ComboBox1: TComboBox;
ListBoxItem1: TListBoxItem;
ListBoxItem2: TListBoxItem;
ListBoxItem3: TListBoxItem;
ListBoxItem4: TListBoxItem;
StyleBook1: TStyleBook;
SkSvg6: TSkSvg;
Layout8: TLayout;
LayoutTop: TLayout;
RectPesq: TRectangle;
EditPesq: TEdit;
Line2: TLine;
LayFiltro: TLayout;
sbFiltro: TRectangle;
mvFiltro: TMultiView;
CalloutRectangle1: TCalloutRectangle;
VertScrollBox1: TVertScrollBox;
LayoutMV: TLayout;
Layout10: TLayout;
Layout11: TLayout;
ALSwitch: TALSwitch;
Text1: TText;
Line1: TLine;
RectFundo: TRectangle;
ColorAnimation2: TColorAnimation;
FloatAnimation2: TFloatAnimation;
ShadowEffect4: TShadowEffect;
ShadowEffect5: TShadowEffect;
Timer1: TTimer;
LayoutCli: TLayout;
SkSvg4: TSkSvg;
Layout1: TLayout;
MultiView1: TMultiView;
Rect12: TRectangle;
LaySair: TLayout;
Label10: TLabel;
Rectangle4: TRectangle;
Layout12: TLayout;
LayCasd: TLayout;
Label18: TLabel;
Layout14: TLayout;
Rectangle8: TRectangle;
LayMenu: TLayout;
Rectangle13: TRectangle;
Layout17: TLayout;
RectMenu: TRectangle;
PathMenu: TPath;
PathExit: TPath;
Label22: TLabel;
TextNumPed: TText;
Layout18: TLayout;
RectWhite: TRectangle;
SkSvg7: TSkSvg;
SkSvg8: TSkSvg;
FloatAnimation3: TFloatAnimation;
ShadowEffect6: TShadowEffect;
SkSvg9: TSkSvg;
FloatAnimation4: TFloatAnimation;
ShadowEffect7: TShadowEffect;
Layout13: TLayout;
Rectangle3: TRectangle;
ColorAnimation3: TColorAnimation;
FloatAnimation5: TFloatAnimation;
ShadowEffect8: TShadowEffect;
SkAnimatedImage2: TSkAnimatedImage;
Rectangle5: TRectangle;
SkSvg10: TSkSvg;
Layout9: TLayout;
Rectangle6: TRectangle;
Editbox: TEdit;
SkSvg11: TSkSvg;
ShadowEffect9: TShadowEffect;
Layout15: TLayout;
Layout16: TLayout;
Rectangle7: TRectangle;
SkLabel2: TSkLabel;
Rectangle9: TRectangle;
FloatAnimation6: TFloatAnimation;
ShadowEffect10: TShadowEffect;
Layout19: TLayout;
SkSvg12: TSkSvg;
ListBox1: TListBox;
mvPop: TMultiView;
LayPop: TRectangle;
frmEdit1: TfrmEdit;
frmBPesq: TfrmButton;
procedure RectButMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X,
Y: Single);
procedure RectButMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X,
Y: Single);
procedure EditEnter(Sender: TObject);
procedure EditExit(Sender: TObject);
procedure ALSwitchChange(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Rectangle3Click(Sender: TObject);
procedure SkAnimatedImage2AnimationFinish(Sender: TObject);
procedure SkSvg10Click(Sender: TObject);
procedure Rectangle9Click(Sender: TObject);
procedure ListBox1ItemClick(const Sender: TCustomListBox; const Item: TListBoxItem);
private
{ Private declarations }
//cor do swith
const SwtColCheck = $FF00A9A7;
const SwtColnoCheck = TAlphaColors.White;
const SwtColnoCheckBk = TAlphaColors.Silver;
//cor do Tedit
const RectEditColEnter = TAlphaColors.Blue;
const RectEditColExit = TAlphaColors.Black;
const RectEditColExitEmpy = TAlphaColors.Red;
public
{ Public declarations }
procedure CarregarListBox(const Texto: array of string);
end;
var
FormDesign: TFormDesign;
implementation
{$R *.fmx}
//Cor ao clicar no TEdit--------------------------------------------------------
procedure TFormDesign.ALSwitchChange(Sender: TObject);
begin
if Sender is TALSwitch then
begin
var
Switch := TALSwitch(Sender);
if Switch.IsChecked then
begin
Switch.Thumb.Fill.Color := SwtColCheck;
Switch.Background.Fill.Color := SwtColCheck;
end
else
begin
Switch.Thumb.Fill.Color := SwtColnoCheck;
Switch.Background.Fill.Color := SwtColnoCheckBk;
end;
end;
end;
procedure TFormDesign.EditEnter(Sender: TObject);
Var
I, j : Integer;
Rect : TRectangle;
skLabel : TSkLabel;
skSvg : TSkSvg;
begin
if Sender is TEdit then
begin
Rect := TRectangle(TEdit(Sender).Parent);
for I := 0 to TEdit(Sender).ControlsCount - 1 do
if TEdit(Sender).Controls[i] is TSkSvg then
begin
TSkSvg(TEdit(Sender).Controls[i]).Visible := False;
Break;
end;
end;
if Sender is TComboBox then
begin
Rect := TRectangle(TComboBox(Sender).Parent);
for I := 0 to TComboBox(Sender).ControlsCount - 1 do
if TComboBox(Sender).Controls[i] is TSkSvg then
begin
TSkSvg(TComboBox(Sender).Controls[i]).Visible := False;
Break;
end;
end;
for I := 0 to Rect.ControlsCount - 1 do
if Rect.Controls[i] is TLayout then
begin
TSkLabel(
TRectangle(
TLayout(
TLayout(
Rect
.Controls[i])
.Controls[0])
.Controls[0])
.Controls[0]).TextSettings.FontColor := RectEditColEnter;
Break;
end;
Rect.Stroke.Color := RectEditColEnter;
end;
//Cor ao sair do TEdit----------------------------------------------------------
procedure TFormDesign.EditExit(Sender: TObject);
var
I, j : Integer;
Rect : TRectangle;
skLabel : TSkLabel;
skSvg : TSkSvg;
Combo : TComboBox;
Check : Boolean;
begin
Check := False;
if Sender is TEdit then
begin
Rect := TRectangle(TEdit(Sender).Parent);
for I := 0 to TEdit(Sender).ControlsCount - 1 do
if TEdit(Sender).Controls[i] is TSkSvg then
begin
skSvg := TSkSvg(TEdit(Sender).Controls[i]);
Break;
end;
if (TEdit(Sender).Text = '') and TEdit(Sender).Enabled then
Check := True;
end;
if Sender is TComboBox then
begin
Rect := TRectangle(TComboBox(Sender).Parent);
for I := 0 to TComboBox(Sender).ControlsCount - 1 do
if TComboBox(Sender).Controls[i] is TSkSvg then
begin
skSvg := TSkSvg(TComboBox(Sender).Controls[i]);
Break;
end;
if (TComboBox(Sender).ItemIndex < 1) and TComboBox(Sender).Enabled then
Check := True;
end;
for I := 0 to Rect.ControlsCount - 1 do
if Rect.Controls[i] is TLayout then
Break;
skLabel := TSkLabel(
TRectangle(
TLayout(
TLayout(
Rect.Controls[i])
.Controls[0])
.Controls[0])
.Controls[0]);
if Check then
begin
skSvg.Visible := True;
Rect.Stroke.Color := TAlphaColors.Red;
skLabel.TextSettings.FontColor := RectEditColExitEmpy;
end
else
begin
skSvg.Visible := False;
Rect.Stroke.Color := TAlphaColors.Black;
skLabel.TextSettings.FontColor := RectEditColExit;
end;
end;
procedure TFormDesign.ListBox1ItemClick(const Sender: TCustomListBox; const Item: TListBoxItem);
begin
Editbox.Text := item.Text;
mvPop.HideMaster;
end;
procedure TFormDesign.Rectangle3Click(Sender: TObject);
var
i : Integer;
fClose: Double;
begin
if TRectangle(Sender).TagString = 'S' then Exit;
TRectangle(Sender).TagString := 'S';
for I := 0 to TRectangle(Sender).ChildrenCount -1 do
if TRectangle(Sender).Children[i] is TSkAnimatedImage then
Break;
TSkAnimatedImage(TRectangle(Sender).Children[i]).Animation.Start;
end;
procedure TFormDesign.Rectangle9Click(Sender: TObject);
begin
mvPop.Width := LayPop.Width;
LayPop.OnClick(Self);
end;
procedure TFormDesign.RectButMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X,
Y: Single);
var
I : Integer;
begin
for I := 0 to TRectangle(Sender).ChildrenCount -1 do
if TRectangle(Sender).Children[i] is TSkAnimatedImage then
if TRectangle(Sender).TagString = 'S' then Exit;
TRectangle(Sender).opacity := 0.8;
end;
procedure TFormDesign.RectButMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X,
Y: Single);
begin
TRectangle(Sender).opacity := 1;
end;
procedure TFormDesign.SkAnimatedImage2AnimationFinish(Sender: TObject);
var
fClose : Double;
begin
fClose := 0.12;
if TSkAnimatedImage(Sender).Animation.Progress = fClose then
TSkAnimatedImage(Sender).Animation.Inverse := False
else
TSkAnimatedImage(Sender).Animation.Inverse := True;
TRectangle(TSkAnimatedImage(Sender).Parent).TagString := '';
end;
procedure TFormDesign.SkSvg10Click(Sender: TObject);
begin
TEdit(TSkSvg(Sender).Parent).Text := '';
end;
procedure TFormDesign.Timer1Timer(Sender: TObject);
var
Texto : array of string;
begin
Timer1.Enabled := False;
frmEdit1.SkSvgAlert.Visible := False;
SkSvgAlert2.Visible := False;
frmEdit1.EditColEnter := TAlphaColors.Blue;
frmEdit1.EditColExit := TAlphaColors.Black;
frmEdit1.EditColExitEmpy := TAlphaColors.Red;
// Defina a string com todas as palavras
SetLength(Texto, 5);
Texto[0] := 'Maçã';
Texto[1] := 'Laranja';
Texto[2] := 'Banana';
Texto[3] := 'Morango';
Texto[4] := 'Abacaxi';
// Chama a função CarregarListView passando o array de strings
CarregarListBox(Texto);
end;
procedure TFormDesign.CarregarListBox(const Texto: array of string);
var
Item: TListBoxItem;
I : Integer;
begin
// Limpa o ListBox antes de adicionar novos itens
ListBox1.Clear;
// Adiciona cada texto como um item separado no ListBox
for I := 0 to Length(Texto) - 1 do
begin
// Cria um novo item para cada texto
Item := TListBoxItem.Create(ListBox1);
Item.Text := Texto[I];
Item.Height := 25; // Define a altura do item
ListBox1.AddObject(Item);
end;
end;
end.