-
Notifications
You must be signed in to change notification settings - Fork 1
/
Unit1.pas
64 lines (53 loc) · 1.45 KB
/
Unit1.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
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, Xml.xmldom,
Xml.XMLIntf, Xml.XMLDoc, uCiaXml, Xml.adomxmldom, FMX.StdCtrls, FMX.Ani,
FMX.Objects;
type
TfmxForm = class(TForm)
XMLConfig1: TXMLConfig;
ToolBar1: TToolBar;
sbMenu: TSpeedButton;
rcPopup: TRectangle;
PopupAnimation: TFloatAnimation;
procedure FormCreate(Sender: TObject);
procedure sbMenuClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure ShowPopup;
procedure HidePopup;
end;
var
fmxForm: TfmxForm;
implementation
{$R *.fmx}
procedure TfmxForm.FormCreate(Sender: TObject);
begin
rcPopup.Position.Y := - rcPopup.Height;
end;
procedure TfmxForm.ShowPopup;
begin
if (rcPopup.Position.Y = -rcPopup.Height) then begin
PopupAnimation.StartValue:= -rcPopup.Height;
PopupAnimation.StopValue:= ToolBar1.Height;
PopupAnimation.Start;
end;
end;
procedure TfmxForm.HidePopup;
begin
if (rcPopup.Position.Y = ToolBar1.Height) then begin
PopupAnimation.StartValue:= ToolBar1.Height;
PopupAnimation.StopValue:= -rcPopup.Height;
PopupAnimation.Start;
end;
end;
procedure TfmxForm.sbMenuClick(Sender: TObject);
begin
if (rcPopup.Position.Y = -rcPopup.Height) then ShowPopup
else HidePopup;
end;
end.