-
Notifications
You must be signed in to change notification settings - Fork 7
/
ChatFMX.Frame.Window.pas
69 lines (56 loc) · 1.38 KB
/
ChatFMX.Frame.Window.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
unit ChatFMX.Frame.Window;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls,
VK.API, FMX.Objects, FMX.Ani, ChatFMX.DM.Res;
type
TFrameWindow = class(TFrame)
RectangleBackground: TRectangle;
procedure RectangleBackgroundClick(Sender: TObject);
private
FVK: TCustomVK;
FHidding: Boolean;
procedure SetVK(const Value: TCustomVK);
public
constructor Create(AOwner: TComponent; AVK: TCustomVK); reintroduce;
procedure ShowFrame;
procedure HideFrame;
property VK: TCustomVK read FVK write SetVK;
end;
implementation
{$R *.fmx}
{ TFrameWindow }
constructor TFrameWindow.Create(AOwner: TComponent; AVK: TCustomVK);
begin
inherited Create(AOwner);
FHidding := False;
Name := '';
Visible := False;
FVK := AVK;
end;
procedure TFrameWindow.HideFrame;
begin
if FHidding then
Exit;
FHidding := True;
TAnimator.AnimateFloatWait(Self, 'Opacity', 0);
Visible := False;
TThread.ForceQueue(nil, Free);
end;
procedure TFrameWindow.RectangleBackgroundClick(Sender: TObject);
begin
HideFrame;
end;
procedure TFrameWindow.SetVK(const Value: TCustomVK);
begin
FVK := Value;
end;
procedure TFrameWindow.ShowFrame;
begin
Opacity := 0;
Visible := True;
BringToFront;
TAnimator.AnimateFloat(Self, 'Opacity', 1);
end;
end.