-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTheAudioDB_configformunit.pas
63 lines (52 loc) · 1.52 KB
/
TheAudioDB_configformunit.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
{$I SCRAPER_DEFINES.INC}
unit TheAudioDB_configformunit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TConfigForm = class(TForm)
SecureCommCB: TCheckBox;
OKButton: TButton;
CancelButton: TButton;
edtMinMediaNameLengthForScrapingByName: TEdit;
lblMinMediaNameLengthForScrapingByName: TLabel;
procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure edtMinMediaNameLengthForScrapingByNameKeyPress(
Sender: TObject; var Key: Char);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
ConfigForm: TConfigForm = nil;
implementation
{$R *.dfm}
procedure TConfigForm.FormKeyPress(Sender: TObject; var Key: Char);
begin
If Key = #27 then
Begin
Key := #0;
Close;
End;
end;
procedure TConfigForm.edtMinMediaNameLengthForScrapingByNameKeyPress(
Sender: TObject; var Key: Char);
begin
if not(Key in [#0..#31,'0'..'9']) then Key := #0;
end;
procedure TConfigForm.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
if (Self.ModalResult = mrOK) and (StrToIntDef(edtMinMediaNameLengthForScrapingByName.Text , -1) <= 0) then
Begin
edtMinMediaNameLengthForScrapingByName.SetFocus;
edtMinMediaNameLengthForScrapingByName.SelectAll;
ShowMessage('Please enter a positive number!');
CanClose := False;
Exit;
End;
end;
end.