This repository was archived by the owner on Jan 23, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnit16.pas
More file actions
104 lines (87 loc) · 2.46 KB
/
Unit16.pas
File metadata and controls
104 lines (87 loc) · 2.46 KB
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
unit Unit16;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Spin, ActnList;
type
TSplineForm = class(TForm)
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
SpinEdit1: TSpinEdit;
Label1: TLabel;
Button1: TButton;
procedure FormShow(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure SpinEdit1Change(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure CheckBox2Click(Sender: TObject);
procedure FromShow1(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormDeactivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
SplineForm: TSplineForm;
implementation
uses LevelEngine, Unit1, Tools;
{$R *.dfm}
procedure TSplineForm.FormShow(Sender: TObject);
begin
if Level.Tool is TSplineTool then with (Level.Tool as TSplineTool) do begin
CheckBox1.Checked:=DelSpline;
CheckBox2.Checked:=OnePolygon;
SpinEdit1.Value:=parts;
end;
end;
procedure TSplineForm.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (ActiveControl<>SpinEdit1) then begin
Level.KeyPressed(Key);
end;
end;
procedure TSplineForm.SpinEdit1Change(Sender: TObject);
begin
if (Level.Tool is TSplineTool) then begin
if SpinEdit1.Value<1 then SpinEdit1.Value:=1;
(Level.Tool as TSplineTool).parts:=SpinEdit1.Value;
Level.Draw;
end;
end;
procedure TSplineForm.Button1Click(Sender: TObject);
begin
if Level.Tool is TSplineTool then
Level.Tool.KeyPressed(VK_RETURN);
end;
procedure TSplineForm.CheckBox1Click(Sender: TObject);
begin
if Level.Tool is TSplineTool then
(Level.Tool as TSplineTool).DelSpline:=CheckBox1.Checked;
end;
procedure TSplineForm.CheckBox2Click(Sender: TObject);
begin
if Level.Tool is TSplineTool then
(Level.Tool as TSplineTool).OnePolygon:=CheckBox2.Checked;
end;
procedure TSplineForm.FromShow1(Sender: TObject);
begin
if Level.Tool is TSplineTool then with (Level.Tool as TSplineTool) do begin
DelSpline:=CheckBox1.Checked;
OnePolygon:=CheckBox2.Checked;
parts:=SpinEdit1.Value;
end;
end;
procedure TSplineForm.FormActivate(Sender: TObject);
begin
ALEForm.ActionList1.State:=asSuspended;
end;
procedure TSplineForm.FormDeactivate(Sender: TObject);
begin
ALEForm.ActionList1.State:=asNormal;
end;
end.