-
Notifications
You must be signed in to change notification settings - Fork 0
/
ADBRDRUN.PAS
131 lines (118 loc) · 3.47 KB
/
ADBRDRUN.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
unit adbrdrun;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
Buttons, ExtCtrls, ComCtrls,Registry;
type
TAddBRDRDLG = class(TForm)
OKBtn: TButton;
CancelBtn: TButton;
BRDRSZGRP: TGroupBox;
SymmCHK: TCheckBox;
topcap: TLabel;
toped: TEdit;
topud: TUpDown;
btmcap: TLabel;
btmed: TEdit;
btmud: TUpDown;
lefted: TEdit;
LeftCAP: TLabel;
leftud: TUpDown;
rghtcap: TLabel;
rghted: TEdit;
rghtud: TUpDown;
procedure FormCreate(Sender: TObject);
procedure topedChange(Sender: TObject);
procedure btmedChange(Sender: TObject);
procedure leftedChange(Sender: TObject);
procedure rghtedChange(Sender: TObject);
procedure SymmCHKClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
AddBRDRDLG: TAddBRDRDLG;
function ShowADDBRDRDLG(var TopA, BottomA, LeftA, RightA : integer) : integer;
implementation
{$R *.DFM}
uses dpemform;
function ShowADDBRDRDLG(var TopA, BottomA, LeftA, RightA : integer) : integer;
begin
with TAddBRDRDLG.Create(Application) do
try
result := ShowModal;
if Result = mrOK then
begin
TopA := TopUD.Position;
BottomA := btmud.Position;
LeftA := leftud.Position;
RightA := rghtud.Position;
RegIniFile := TRegIniFile.Create(DPEIniName);
RegIniFile.WriteInteger('AddBorders','Top',topUd.Position);
RegIniFile.WriteInteger('AddBorders','Bottom',BtmUd.Position);
RegIniFile.WriteInteger('AddBorders','Left',Leftud.Position);
RegIniFile.WriteInteger('AddBorders','Right', RghtUd.Position);
RegIniFile.WriteBool('AddBorders','Symmetric', SymmCHK.Checked);
RegIniFile.Free;
end;
finally
Free;
end;
end;
procedure TAddBRDRDLG.FormCreate(Sender: TObject);
begin
RegIniFile := TRegIniFile.Create(DPEIniName);
topud.Position := RegIniFile.ReadInteger('AddBorders','Top',0);
btmud.Position := RegIniFile.ReadInteger('AddBorders','Bottom',0);
leftud.Position := RegIniFile.ReadInteger('AddBorders','Left',0);
rghtud.Position := RegIniFile.ReadInteger('AddBorders','Right', 0);
SymmCHK.Checked := RegIniFile.ReadBool('AddBorders','Symmetric', False);
RegIniFile.Free;
topEdChange(Sender);
end;
procedure TAddBRDRDLG.topedChange(Sender: TObject);
begin
//if topEd.Text <> '' then topud.Position := StrToInt(TopEd.Text);
if SymmCHK.Checked then
begin
btmud.Position := topud.Position;
leftud.Position := topud.Position;
rghtud.Position := topud.Position;
end;
end;
procedure TAddBRDRDLG.btmedChange(Sender: TObject);
begin
//if btmEd.Text <> '' then btmud.Position := StrToInt(btmEd.Text);
if SymmCHK.Checked then
begin
topud.Position := btmud.Position;
leftud.Position := btmud.Position;
rghtud.Position := btmud.Position;
end;
end;
procedure TAddBRDRDLG.leftedChange(Sender: TObject);
begin
//if leftEd.Text <> '' then leftud.Position := StrToInt(leftEd.Text);
if SymmCHK.Checked then
begin
btmud.Position := leftud.Position;
topud.Position := leftud.Position;
rghtud.Position := leftud.Position;
end;
end;
procedure TAddBRDRDLG.rghtedChange(Sender: TObject);
begin
//if rghtEd.Text <> '' then rghtud.Position := StrToInt(rghted.Text);
if SymmCHK.Checked then
begin
btmud.Position := rghtud.Position;
leftud.Position := rghtud.Position;
topud.Position := rghtud.Position;
end;
end;
procedure TAddBRDRDLG.SymmCHKClick(Sender: TObject);
begin
topEdChange(Sender);
end;
end.