-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathudRegistryPrompt.pas
65 lines (53 loc) · 1.62 KB
/
udRegistryPrompt.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
unit udRegistryPrompt;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TdRegistryPrompt = class(TForm)
pnlRegistry: TPanel;
edtRegister: TLabeledEdit;
edtStore: TLabeledEdit;
btnRegistry: TButton;
lblChangeRegistry: TLabel;
lblStoreTitle: TLabel;
lblStore: TLabel;
lblRegisterTitle: TLabel;
lblRegister: TLabel;
procedure btnRegistryClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure SetUp(aStore, aRegister, lStoreReg, lRegisterReg : string);
end;
implementation
uses uuGlobals;
{$R *.dfm}
procedure TdRegistryPrompt.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then
Close;
end;
procedure TdRegistryPrompt.FormShow(Sender: TObject);
begin
btnRegistry.SetFocus;
end;
procedure TdRegistryPrompt.SetUp(aStore, aRegister, lStoreReg, lRegisterReg : string);
begin
lblStore.Caption := lStoreReg;
lblRegister.Caption := lRegisterReg;
edtRegister.Text := aRegister;
edtStore.Text := aStore;
end;
procedure TdRegistryPrompt.btnRegistryClick(Sender: TObject);
begin
SetRegistry(edtStore.Text, 'location_code', POS_DIRECTORY);
SetRegistry(edtRegister.Text, 'register_code', POS_DIRECTORY);
SetRegistry('POS' + edtStore.Text + edtRegister.Text, 'remedipc_id', POS_DIRECTORY);
ModalResult := mrOk;
end;
end.