You've already forked lazarus-ccr
LazBarcodes: Add QRClock demo project.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8356 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
29
components/lazbarcodes/examples/qrclock/main.lfm
Normal file
29
components/lazbarcodes/examples/qrclock/main.lfm
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
object MainForm: TMainForm
|
||||||
|
Left = 327
|
||||||
|
Height = 260
|
||||||
|
Top = 130
|
||||||
|
Width = 260
|
||||||
|
AutoSize = True
|
||||||
|
BorderStyle = bsDialog
|
||||||
|
Caption = 'QRClock'
|
||||||
|
ClientHeight = 260
|
||||||
|
ClientWidth = 260
|
||||||
|
OnCreate = FormCreate
|
||||||
|
object BarcodeQR: TBarcodeQR
|
||||||
|
Left = 0
|
||||||
|
Height = 260
|
||||||
|
Top = 0
|
||||||
|
Width = 260
|
||||||
|
ParentColor = False
|
||||||
|
Text = 'TBarcodeQR'
|
||||||
|
Scale = 12
|
||||||
|
AutoSize = True
|
||||||
|
RecommendedSymbolSize = False
|
||||||
|
end
|
||||||
|
object Timer: TTimer
|
||||||
|
Interval = 250
|
||||||
|
OnTimer = TimerTimer
|
||||||
|
Left = 106
|
||||||
|
Top = 101
|
||||||
|
end
|
||||||
|
end
|
59
components/lazbarcodes/examples/qrclock/main.pas
Normal file
59
components/lazbarcodes/examples/qrclock/main.pas
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
unit main;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, ubarcodes;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TMainForm }
|
||||||
|
|
||||||
|
TMainForm = class(TForm)
|
||||||
|
BarcodeQR: TBarcodeQR;
|
||||||
|
Timer: TTimer;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure TimerTimer(Sender: TObject);
|
||||||
|
private
|
||||||
|
|
||||||
|
public
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
MainForm: TMainForm;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.lfm}
|
||||||
|
|
||||||
|
{ TMainForm }
|
||||||
|
|
||||||
|
procedure TMainForm.TimerTimer(Sender: TObject);
|
||||||
|
var
|
||||||
|
dt: TDateTime;
|
||||||
|
sd, st: String;
|
||||||
|
begin
|
||||||
|
dt := Now();
|
||||||
|
sd := FormatDateTime('dddddd', dt);
|
||||||
|
st := FormatDateTime('hh:nn:ss', dt);
|
||||||
|
Caption := 'QRClock: ' + sd + ' - ' + st;
|
||||||
|
BarcodeQR.Text := sd + LineEnding + st;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.FormCreate(Sender: TObject);
|
||||||
|
var
|
||||||
|
w: Integer = 0;
|
||||||
|
h: Integer = 0;
|
||||||
|
begin
|
||||||
|
// Avoid switching to final form size while form is already visible
|
||||||
|
TimerTimer(nil);
|
||||||
|
BarcodeQR.GetPreferredSize(w, h);
|
||||||
|
Width := w;
|
||||||
|
Height := h;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
BIN
components/lazbarcodes/examples/qrclock/qrclock.ico
Normal file
BIN
components/lazbarcodes/examples/qrclock/qrclock.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 130 KiB |
85
components/lazbarcodes/examples/qrclock/qrclock.lpi
Normal file
85
components/lazbarcodes/examples/qrclock/qrclock.lpi
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<Version Value="12"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<General>
|
||||||
|
<Flags>
|
||||||
|
<CompatibilityMode Value="True"/>
|
||||||
|
</Flags>
|
||||||
|
<SessionStorage Value="InProjectDir"/>
|
||||||
|
<Title Value="qrclock"/>
|
||||||
|
<Scaled Value="True"/>
|
||||||
|
<ResourceType Value="res"/>
|
||||||
|
<UseXPManifest Value="True"/>
|
||||||
|
<XPManifest>
|
||||||
|
<DpiAware Value="True"/>
|
||||||
|
</XPManifest>
|
||||||
|
<Icon Value="0"/>
|
||||||
|
</General>
|
||||||
|
<BuildModes Count="1">
|
||||||
|
<Item1 Name="Default" Default="True"/>
|
||||||
|
</BuildModes>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<UseFileFilters Value="True"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<FormatVersion Value="2"/>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="2">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="lazbarcodes"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<PackageName Value="LCL"/>
|
||||||
|
</Item2>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="2">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="qrclock.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="main.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="MainForm"/>
|
||||||
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
</Unit1>
|
||||||
|
</Units>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="11"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Target>
|
||||||
|
<Filename Value="qrclock"/>
|
||||||
|
</Target>
|
||||||
|
<SearchPaths>
|
||||||
|
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||||
|
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||||
|
</SearchPaths>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<DebugInfoType Value="dsDwarf3"/>
|
||||||
|
</Debugging>
|
||||||
|
<Options>
|
||||||
|
<Win32>
|
||||||
|
<GraphicApplication Value="True"/>
|
||||||
|
</Win32>
|
||||||
|
</Options>
|
||||||
|
</Linking>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions Count="3">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="EAbort"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item2>
|
||||||
|
<Item3>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item3>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
25
components/lazbarcodes/examples/qrclock/qrclock.lpr
Normal file
25
components/lazbarcodes/examples/qrclock/qrclock.lpr
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
program qrclock;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF UNIX}
|
||||||
|
cthreads,
|
||||||
|
{$ENDIF}
|
||||||
|
{$IFDEF HASAMIGA}
|
||||||
|
athreads,
|
||||||
|
{$ENDIF}
|
||||||
|
Interfaces, // this includes the LCL widgetset
|
||||||
|
Forms, main
|
||||||
|
{ you can add units after this };
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
RequireDerivedFormResource:=True;
|
||||||
|
Application.Scaled:=True;
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TMainForm, MainForm);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
|
|
Reference in New Issue
Block a user