-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUPadForm.pas
More file actions
62 lines (51 loc) · 1.28 KB
/
Copy pathUPadForm.pas
File metadata and controls
62 lines (51 loc) · 1.28 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
unit UPadForm;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TPadEntriesForm = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
edStrRef: TEdit;
Label6: TLabel;
btnOK: TButton;
btnCancel: TButton;
lblCurrent: TLabel;
Bevel1: TBevel;
BorderPanel: TPanel;
procedure edStrRefKeyPress(Sender: TObject; var Key: Char);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
strref : DWORD;
procedure Reposition(x, y : word);
end;
var
PadEntriesForm: TPadEntriesForm;
implementation
{$R *.DFM}
procedure TPadEntriesForm.edStrRefKeyPress(Sender: TObject; var Key: Char);
begin
if not (Key in [^Z, ^X, ^C, ^V, #8, '0'..'9']) then begin
Key := #0;
beep();
end;
end;
procedure TPadEntriesForm.Reposition(x, y : word);
begin
Left := x;
Top := y;
end;
procedure TPadEntriesForm.FormShow(Sender: TObject);
begin
edStrRef.text := IntToStr(strref + 1);
lblCurrent.caption := '(current range: 0 to ' + IntToStr(strref - 1) + ')';
edStrRef.setfocus();
end;
end.