-
-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathChatGPT.FrameUIMessage.pas
58 lines (46 loc) · 1.2 KB
/
ChatGPT.FrameUIMessage.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
unit ChatGPT.FrameUIMessage;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls,
FMX.Layouts, FMX.Objects, FMX.Controls.Presentation;
type
TFrameUIMessage = class(TFrame)
LayoutContent: TLayout;
RectangleBG: TRectangle;
LabelText: TLabel;
TimerClose: TTimer;
procedure LabelTextResize(Sender: TObject);
procedure TimerCloseTimer(Sender: TObject);
private
{ Private declarations }
public
constructor Create(AOwner: TComponent); override;
end;
procedure ShowUIMessage(const Text: string);
implementation
{$R *.fmx}
procedure ShowUIMessage(const Text: string);
begin
with TFrameUIMessage.Create(Application) do
begin
LabelText.Text := Text;
Align := TAlignLayout.Client;
Parent := Application.MainForm;
BringToFront;
end;
end;
constructor TFrameUIMessage.Create(AOwner: TComponent);
begin
inherited;
Name := '';
end;
procedure TFrameUIMessage.LabelTextResize(Sender: TObject);
begin
RectangleBG.Width := LabelText.Width + 20;
end;
procedure TFrameUIMessage.TimerCloseTimer(Sender: TObject);
begin
Release;
end;
end.