forked from Noso-Project/NosoLite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nl_qrcode.pas
74 lines (56 loc) · 1.31 KB
/
nl_qrcode.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
unit nl_qrcode;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
ubarcodes;
type
{ TForm2 }
TForm2 = class(TForm)
BarcodeQR1: TBarcodeQR;
Button1: TButton;
Button2: TButton;
Labelqrcode: TLabel;
PnaelQRbuttons: TPanel;
PanelQRcode: TPanel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormShow(Sender: TObject);
private
public
end;
var
Form2: TForm2;
QRAddress, QRKeys : string;
implementation
{$R *.lfm}
{ TForm2 }
// Show address at open
procedure TForm2.FormShow(Sender: TObject);
Begin
Labelqrcode.Font.Color:=clBlack;
BarcodeQR1.Text:=QRAddress;
Labelqrcode.Caption:=QRAddress;
End;
// Show address button
procedure TForm2.Button1Click(Sender: TObject);
Begin
Labelqrcode.Font.Color:=clBlack;
BarcodeQR1.Text:=QRAddress;
Labelqrcode.Caption:=QRAddress;
End;
// Show keys button
procedure TForm2.Button2Click(Sender: TObject);
Begin
Labelqrcode.Font.Color:=clRed;
BarcodeQR1.Text:=QRKeys;
Labelqrcode.Caption:='['+QRAddress+']';
End;
// Clean variables onclose
procedure TForm2.FormClose(Sender: TObject; var CloseAction: TCloseAction);
Begin
QRAddress := '';
QRKeys := '';
End;
END.