-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCRSZUN.PAS
62 lines (54 loc) · 1.5 KB
/
CRSZUN.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
unit crszun;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
Buttons, ExtCtrls, ComCtrls, Registry;
type
Tcrszfrm = class(TForm)
OKBtn: TButton;
CancelBtn: TButton;
Bevel: TBevel;
widthed: TEdit;
wcap: TLabel;
hcap: TLabel;
highted: TEdit;
centerchk: TCheckBox;
widthud: TUpDown;
heightud: TUpDown;
private
{ Private declarations }
public
{ Public declarations }
end;
var
crszfrm: Tcrszfrm;
function ShowCRSZ(var w,h : word; var center : boolean): integer;
implementation
uses dpemform;
function ShowCRSZ(var w,h : word; var center : boolean): integer;
var RegIniFile : TRegIniFile;
begin
with Tcrszfrm.Create(Application) do
try
RegIniFile := TRegIniFile.Create(DPEIniName);
widthud.Position := RegIniFile.ReadInteger('ResizeCanvas','Width',w);
heightud.Position := RegIniFile.ReadInteger('ResizeCanvas','Height',h);
centerchk.Checked := RegIniFile.ReadBool('ResizeCanvas','Center',False);
RegIniFile.Free;
Result := ShowModal;
if Result = mrOK then
begin
w := widthud.Position;
h := heightud.Position;
center := centerchk.Checked;
RegIniFile := TRegIniFile.Create(DPEIniName);
RegIniFile.WriteInteger('ResizeCanvas','Width',widthud.Position);
RegIniFile.WriteInteger('ResizeCanvas','Height',heightud.Position);
RegIniFile.WriteBool('ResizeCanvas','Center',centerchk.Checked);
RegIniFile.Free;
end;
finally
Free;
end;
end;
{$R *.DFM}
end.