-
Notifications
You must be signed in to change notification settings - Fork 123
/
uSaveUnitForm.pas
76 lines (62 loc) · 1.73 KB
/
uSaveUnitForm.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
69
70
71
72
73
74
75
76
unit uSaveUnitForm;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls,
FMX.Layouts, FMX.Memo;
type
TSaveUnitForm = class(TForm)
Memo1: TMemo;
Panel1: TPanel;
btnClose: TButton;
btnSave: TButton;
sd: TSaveDialog;
Label1: TLabel;
StyleBook1: TStyleBook;
procedure btnCloseClick(Sender: TObject);
procedure btnSaveClick(Sender: TObject);
procedure Memo1KeyUp(Sender: TObject; var Key: Word; var KeyChar: Char;
Shift: TShiftState);
procedure FormKeyDown(Sender: TObject; var Key: Word; var KeyChar: Char;
Shift: TShiftState);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
SaveUnitForm: TSaveUnitForm;
implementation
{$R *.fmx}
uses uMainForm;
procedure TSaveUnitForm.btnCloseClick(Sender: TObject);
begin
ModalResult := mrCancel;
end;
procedure TSaveUnitForm.btnSaveClick(Sender: TObject);
begin
if sd.Execute then
begin
end;
end;
procedure TSaveUnitForm.FormKeyDown(Sender: TObject; var Key: Word;
var KeyChar: Char; Shift: TShiftState);
begin
if Key = 27 then
ModalResult := mrCancel;
end;
procedure TSaveUnitForm.FormShow(Sender: TObject);
begin
SaveUnitForm.width := MainForm.Width - 50;
SaveUnitForm.height := MainForm.Height - 50;
SaveUnitForm.left := MainForm.Left + 25;
SaveUnitForm.top := MainForm.Top + 25;
end;
procedure TSaveUnitForm.Memo1KeyUp(Sender: TObject; var Key: Word;
var KeyChar: Char; Shift: TShiftState);
begin
if Key = 27 then
ModalResult := mrCancel;
end;
end.