-
Notifications
You must be signed in to change notification settings - Fork 17
/
FXMImport.pas
138 lines (118 loc) · 2.6 KB
/
FXMImport.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
132
133
134
135
136
137
138
{
This is part of Vortex Tracker II project
(c)2000-2009 S.V.Bulba
Author: Sergey Bulba, [email protected]
Support page: http://bulba.untergrund.net/
Version 2.0 and later
(c)2017-2021 Ivan Pirog, [email protected]
https://github.com/ivanpirog/vortextracker
}
unit FXMImport;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TFXMParams = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Label3: TLabel;
Edit2: TEdit;
Label4: TLabel;
Edit3: TEdit;
Label5: TLabel;
Edit4: TEdit;
Button1: TButton;
Button2: TButton;
Label2: TLabel;
Edit5: TEdit;
Edit6: TEdit;
Label6: TLabel;
procedure Edit1Change(Sender: TObject);
procedure Edit2Change(Sender: TObject);
procedure Edit3Change(Sender: TObject);
procedure Edit4Change(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure CheckAll;
procedure Edit5Change(Sender: TObject);
procedure Edit6Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FXMParams: TFXMParams;
implementation
uses trfuncs;
{$R *.dfm}
procedure TFXMParams.Edit1Change(Sender: TObject);
begin
if Edit1.Modified then CheckAll
end;
procedure TFXMParams.Edit2Change(Sender: TObject);
begin
if Edit2.Modified then CheckAll
end;
procedure TFXMParams.Edit3Change(Sender: TObject);
begin
if Edit3.Modified then CheckAll
end;
procedure TFXMParams.Edit4Change(Sender: TObject);
begin
if Edit4.Modified then CheckAll
end;
procedure TFXMParams.Edit5Change(Sender: TObject);
begin
if Edit5.Modified then CheckAll
end;
procedure TFXMParams.Edit6Change(Sender: TObject);
begin
if Edit6.Modified then CheckAll
end;
procedure TFXMParams.FormShow(Sender: TObject);
begin
CheckAll
end;
procedure TFXMParams.CheckAll;
var
flg: boolean;
s: string;
i, l, j: integer;
begin
s := Trim(Edit1.Text);
Val(s, l, j);
flg := (j = 0) and (l > 0) and (l <= 2167500);
if flg then
begin
s := Trim(Edit2.Text);
Val(s, i, j);
flg := (j = 0) and (i >= 0) and (i < l)
end;
if flg then
begin
s := Trim(Edit3.Text);
Val(s, i, j);
flg := (j = 0) and (i in [1..255])
end;
if flg then
begin
s := Trim(Edit4.Text);
Val(s, i, j);
flg := (j = 0) and (i > 0) and (i <= MaxPatLen)
end;
if flg then
begin
s := Trim(Edit5.Text);
Val(s, i, j);
flg := (j = 0) and ((i + 95) in [0..190])
end;
if flg then
begin
s := Trim(Edit6.Text);
Val(s, i, j);
flg := (j = 0) and (i in [0, 1, 3, 7, 15, 31])
end;
Button1.Enabled := Flg;
end;
end.