-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAddValueUnit.pas
62 lines (49 loc) · 1.28 KB
/
AddValueUnit.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
unit AddValueUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, Mask;
type
TAddValueForm = class(TForm)
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
ValueEdit: TMaskEdit;
Label1: TLabel;
procedure BitBtn1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure set_values(formName:String;LabelName:String; mask:string);
end;
var
AddValueForm: TAddValueForm;
implementation
{$R *.dfm}
procedure TAddValueForm.BitBtn1Click(Sender: TObject);
begin
if trim(ValueEdit.Text) = '' then
ShowMessage('Çíà÷åíèå ïàðàìåòðà íå ââåäåíî.')
else
ModalResult := mrOk;
end;
procedure TAddValueForm.set_values(formName, LabelName, mask: string);
begin
self.Caption := formName;
label1.Caption := LabelName;
ValueEdit.EditMask := mask;
end;
procedure TAddValueForm.FormShow(Sender: TObject);
begin
ValueEdit.SetFocus;
ValueEdit.SelectAll;
end;
procedure TAddValueForm.FormCreate(Sender: TObject);
begin
//ñòàâèì ôîðìó ïî öåíòðó ýêðàíà
self.Left := (screen.Width - self.Width) div 2;
self.Top := (screen.Height - self.Height) div 2;
end;
end.