2020-03-30 18:01:44 +00:00
|
|
|
unit LicenseUnit;
|
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
|
|
|
StdCtrls, ExtCtrls;
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
|
|
{ TLicenseFrm }
|
|
|
|
|
|
|
|
TLicenseFrm = class(TForm)
|
|
|
|
AcceptBtn: TButton;
|
|
|
|
Bevel1: TBevel;
|
|
|
|
Bevel2: TBevel;
|
2020-04-01 08:32:14 +00:00
|
|
|
OKBtn: TButton;
|
2020-03-30 18:01:44 +00:00
|
|
|
RejectBtn: TButton;
|
|
|
|
Memo1: TMemo;
|
|
|
|
Panel1: TPanel;
|
|
|
|
private
|
|
|
|
{ private declarations }
|
|
|
|
public
|
|
|
|
{ public declarations }
|
|
|
|
end;
|
|
|
|
|
|
|
|
var
|
|
|
|
LicenseFrm: TLicenseFrm;
|
|
|
|
|
|
|
|
function AcceptLicenseForm: Boolean;
|
2020-04-01 08:32:14 +00:00
|
|
|
function ShowLicense(FirstTime: Boolean): Boolean;
|
2020-03-30 18:01:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
function AcceptLicenseForm: Boolean;
|
2020-04-01 08:32:14 +00:00
|
|
|
begin
|
|
|
|
Result := ShowLicense(true);
|
|
|
|
end;
|
|
|
|
|
|
|
|
function ShowLicense(FirstTime: Boolean): Boolean;
|
2020-03-30 18:01:44 +00:00
|
|
|
begin
|
|
|
|
with TLicenseFrm.Create(nil) do
|
|
|
|
try
|
2020-04-01 08:32:14 +00:00
|
|
|
OKBtn.Visible := not FirstTime;
|
|
|
|
AcceptBtn.Visible := FirstTime;
|
|
|
|
RejectBtn.Visible := FirstTime;
|
|
|
|
Bevel2.Visible := FirstTime;
|
|
|
|
if FirstTime then
|
|
|
|
Memo1.Lines.Add('Click on Accept or Reject below.');
|
|
|
|
|
2020-03-30 18:01:44 +00:00
|
|
|
Result := (ShowModal = mrOK);
|
|
|
|
finally
|
|
|
|
Free;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
{ TLicenseFrm }
|
|
|
|
|
|
|
|
initialization
|
|
|
|
{$I licenseunit.lrs}
|
|
|
|
|
|
|
|
end.
|
|
|
|
|