forked from lunafe/pray
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsharelinkform.pas
More file actions
57 lines (45 loc) · 1.07 KB
/
sharelinkform.pas
File metadata and controls
57 lines (45 loc) · 1.07 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
unit ShareLinkForm;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls, Profile,
UBarCodes;
type
{ TFormShareLink }
TFormShareLink = class(TForm)
MemoLinkText: TMemo;
ShapeQRCodeLocator: TShape;
procedure ApplyProfile(Profile: TProfile);
procedure FormCreate(Sender: TObject);
private
QR: TBarCodeQR;
public
end;
var
FormShareLink: TFormShareLink;
implementation
{$R *.lfm}
procedure TFormShareLink.ApplyProfile(Profile: TProfile);
var
L: string;
begin
L := Profile.GenerateLink;
MemoLinkText.Lines.Clear;
MemoLinkText.Lines.Add(L);
QR.Text := L;
end;
procedure TFormShareLink.FormCreate(Sender: TObject);
begin
QR := TBarCodeQR.Create(FormShareLink);
with QR do
begin
Parent := FormShareLink;
Left := ShapeQRCodeLocator.Left + 4;
Top := ShapeQRCodeLocator.Top + 4;
Width := ShapeQRCodeLocator.Width - 5;
Height := ShapeQRCodeLocator.Height - 5;
Visible := True;
Text := '';
end;
end;
end.