-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathSaveForm.pas
More file actions
56 lines (42 loc) · 989 Bytes
/
SaveForm.pas
File metadata and controls
56 lines (42 loc) · 989 Bytes
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
unit SaveForm;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls,
Cod.SysUtils, Vcl.TitleBarCtrls;
type
TSave = class(TForm)
Button1: TButton;
Button2: TButton;
Panel1: TPanel;
Msg: TLabel;
Button3: TButton;
TitleBarPanel1: TTitleBarPanel;
private
{ Private declarations }
public
{ Public declarations }
procedure PrepareDialog(FileName: string);
end;
const
SAVE_TEMPLATE = 'Do you want to save changes to %S?';
var
Save: TSave;
implementation
uses
PaintForm;
{$R *.dfm}
{ TForm1 }
procedure TSave.PrepareDialog;
var
AName: string;
begin
CenterFormInForm(Self, Application.MainForm, false);
if FileName = '' then
AName := FileDisplayName
else
AName := FileName;
Height := Msg.Top + Msg.Height + 25 + Panel1.Height;
Msg.Caption := Format(SAVE_TEMPLATE, [AName]);
end;
end.