LazBarcodes: Fix compilation of LazBarcodeDemo with Lazarus v2.0.x

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9135 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2024-01-10 15:31:43 +00:00
parent 26d64bdb4b
commit 988772c25a
4 changed files with 65 additions and 51 deletions

View File

@ -4,6 +4,9 @@
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="LazBarcodeDemo"/>
<Scaled Value="True"/>
@ -13,8 +16,8 @@
<DpiAware Value="True"/>
</XPManifest>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
<BuildModes Count="1">
<Item1 Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
@ -23,26 +26,26 @@
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="lazbarcodes"/>
</Item>
<Item>
</Item1>
<Item2>
<PackageName Value="LCL"/>
</Item>
</Item2>
</RequiredPackages>
<Units>
<Unit>
<Units Count="2">
<Unit0>
<Filename Value="LazBarcodeDemo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
</Unit0>
<Unit1>
<Filename Value="main.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="MainForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit>
</Unit1>
</Units>
</ProjectOptions>
<CompilerOptions>
@ -59,27 +62,32 @@
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Exceptions Count="5">
<Item1>
<Name Value="EAbort"/>
</Item>
<Item>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item>
<Item>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item>
<Item>
</Item3>
<Item4>
<Name Value="FPImageException"/>
<Enabled Value="False"/>
</Item>
<Item>
</Item4>
<Item5>
<Name Value="EInvalidGraphic"/>
<Enabled Value="False"/>
</Item>
</Item5>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -6,8 +6,8 @@ object MainForm: TMainForm
Caption = 'LazBarcode Demo'
ClientHeight = 484
ClientWidth = 811
LCLVersion = '3.99.0.0'
OnCreate = FormCreate
LCLVersion = '2.3.0.0'
object BarcodesTree: TTreeView
Left = 6
Height = 472
@ -20,9 +20,9 @@ object MainForm: TMainForm
BorderSpacing.Bottom = 6
ReadOnly = True
TabOrder = 0
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
OnChange = BarcodesTreeChange
OnCustomDrawItem = BarcodesTreeCustomDrawItem
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
end
object Panel1: TPanel
Left = 211
@ -71,9 +71,9 @@ object MainForm: TMainForm
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 12
BorderSpacing.Right = 4
OnChange = edTextChange
TabOrder = 0
Text = '012345678'
OnChange = edTextChange
end
object gbGeometry: TGroupBox
AnchorSideLeft.Control = Panel2
@ -117,8 +117,8 @@ object MainForm: TMainForm
BorderSpacing.Top = 8
Enabled = False
MaxValue = 20
OnChange = BarcodeChange
TabOrder = 0
OnChange = BarcodeChange
end
object seMargin: TSpinEdit
AnchorSideLeft.Control = seWhiteSpaceWidth
@ -135,9 +135,9 @@ object MainForm: TMainForm
BorderSpacing.Top = 3
Enabled = False
MaxValue = 20
OnChange = BarcodeChange
TabOrder = 1
Value = 4
OnChange = BarcodeChange
end
object lblMargin: TLabel
AnchorSideLeft.Control = gbGeometry
@ -180,9 +180,9 @@ object MainForm: TMainForm
BorderSpacing.Top = 3
Enabled = False
MaxValue = 20
OnChange = BarcodeChange
TabOrder = 2
Value = 8
OnChange = BarcodeChange
end
object lblSymbolHeight: TLabel
AnchorSideLeft.Control = gbGeometry
@ -215,8 +215,8 @@ object MainForm: TMainForm
BorderSpacing.Bottom = 6
Enabled = False
MaxValue = 9999
OnChange = BarcodeChange
TabOrder = 3
OnChange = BarcodeChange
end
object cbRecommendedSymbolSize: TCheckBox
AnchorSideLeft.Control = gbGeometry
@ -230,9 +230,9 @@ object MainForm: TMainForm
BorderSpacing.Right = 6
Caption = 'Recommended symbol size'
Checked = True
OnChange = cbRecommendedSymbolSizeChange
State = cbChecked
TabOrder = 4
OnChange = cbRecommendedSymbolSizeChange
end
object cbAutoSize: TCheckBox
AnchorSideLeft.Control = gbGeometry
@ -243,8 +243,8 @@ object MainForm: TMainForm
Width = 66
BorderSpacing.Left = 16
Caption = 'Auto size'
OnChange = cbAutoSizeChange
TabOrder = 5
OnChange = cbAutoSizeChange
end
end
object gbShow: TGroupBox
@ -271,9 +271,9 @@ object MainForm: TMainForm
BorderSpacing.Left = 16
Caption = 'Human-readable text'
Checked = True
OnChange = BarcodeChange
State = cbChecked
TabOrder = 0
OnChange = BarcodeChange
end
object cmbBearerBarsBox: TComboBox
AnchorSideLeft.Control = gbShow
@ -297,10 +297,10 @@ object MainForm: TMainForm
'Bearer bars'
'Box'
)
OnChange = BarcodeChange
Style = csDropDownList
TabOrder = 2
Text = 'none'
OnChange = BarcodeChange
end
object btnFont: TButton
AnchorSideLeft.Control = cbHumanReadableText
@ -315,8 +315,8 @@ object MainForm: TMainForm
BorderSpacing.Left = 6
BorderSpacing.Right = 6
Caption = 'Font'
OnClick = btnFontClick
TabOrder = 1
OnClick = btnFontClick
end
end
object gbChecksum: TGroupBox
@ -346,9 +346,9 @@ object MainForm: TMainForm
BorderSpacing.Left = 16
Caption = 'Add checksum'
Checked = True
OnChange = BarcodeChange
State = cbChecked
TabOrder = 0
OnChange = BarcodeChange
end
object cbDisplayChecksum: TCheckBox
AnchorSideLeft.Control = cbAddChecksum
@ -361,8 +361,8 @@ object MainForm: TMainForm
BorderSpacing.Top = 4
BorderSpacing.Bottom = 6
Caption = 'Display checksum'
OnChange = BarcodeChange
TabOrder = 1
OnChange = BarcodeChange
end
end
object gbColors: TGroupBox
@ -448,8 +448,8 @@ object MainForm: TMainForm
AutoSize = True
BorderSpacing.Top = 9
Caption = 'Save to file...'
OnClick = btnSaveToFileClick
TabOrder = 4
OnClick = btnSaveToFileClick
end
object btnCopyToClipboard: TBitBtn
AnchorSideLeft.Control = gbChecksum
@ -463,8 +463,8 @@ object MainForm: TMainForm
AutoSize = True
BorderSpacing.Top = 6
Caption = 'Copy to clipboard'
OnClick = btnCopyToClipboardClick
TabOrder = 5
OnClick = btnCopyToClipboardClick
end
object btnSampleText: TSpeedButton
AnchorSideTop.Control = edText
@ -517,8 +517,8 @@ object MainForm: TMainForm
'Q'
'H'
)
OnClick = rgQR_ECCLevelClick
TabOrder = 0
OnClick = rgQR_ECCLevelClick
end
end
object pgOptions_Plessey: TPage
@ -546,8 +546,8 @@ object MainForm: TMainForm
'mod-11'
'mod-10 & mod-11'
)
OnClick = rgPlessey_CheckcharClick
TabOrder = 0
OnClick = rgPlessey_CheckcharClick
end
end
object pgOptions_Maxicode: TPage
@ -582,8 +582,8 @@ object MainForm: TMainForm
'Mode 5'
'Mode 6'
)
OnClick = rgMaxicode_ModeClick
TabOrder = 0
OnClick = rgMaxicode_ModeClick
end
object lblMaxicode_Postcode: TLabel
AnchorSideLeft.Control = pgOptions_Maxicode
@ -608,9 +608,8 @@ object MainForm: TMainForm
Top = 119
Width = 152
Anchors = [akTop, akLeft, akRight]
OnChange = edMaxicode_PostcodeChange
TabOrder = 1
TextHint = 'Enter postcode here'
OnChange = edMaxicode_PostcodeChange
end
object lblMaxicode_CountryCode: TLabel
AnchorSideLeft.Control = pgOptions_Maxicode
@ -888,9 +887,8 @@ object MainForm: TMainForm
'894 - ZAMBIA'
'716 - ZIMBABWE'
)
OnChange = cbMaxicode_CountryCodeChange
TabOrder = 2
TextHint = 'Select item'
OnChange = cbMaxicode_CountryCodeChange
end
object lblMaxicode_ServiceCode: TLabel
AnchorSideLeft.Control = pgOptions_Maxicode
@ -917,9 +915,8 @@ object MainForm: TMainForm
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 2
MaxLength = 3
OnChange = edMaxicode_ServiceCodeChange
TabOrder = 3
TextHint = 'Enter carrier-specific service code'
OnChange = edMaxicode_ServiceCodeChange
end
object lblMaxicode_Primary: TLabel
AnchorSideLeft.Control = pgOptions_Maxicode
@ -946,8 +943,8 @@ object MainForm: TMainForm
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 2
Enabled = False
OnChange = edMaxicode_PrimaryChange
TabOrder = 4
OnChange = edMaxicode_PrimaryChange
end
end
end

View File

@ -5,8 +5,10 @@ unit main;
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, ExtCtrls,
StdCtrls, Spin, Buttons, ExtDlgs, ubarcodes;
Classes, SysUtils,
LCLVersion, Forms, Controls, Graphics, Dialogs, ComCtrls, ExtCtrls,
StdCtrls, Spin, Buttons,
ubarcodes;
type
@ -351,6 +353,13 @@ procedure TMainForm.FormCreate(Sender: TObject);
begin
nbOptions.PageIndex := -1;
PopulateBarcodesTree;
{$IF LCL_FullVersion >= 2020000}
edMaxicode_PostCode.TextHint := 'Enter postcode here';
cbMaxicode_CountryCode.TextHint := 'Select item';
edMaxicode_ServiceCode.TextHint := 'Enter carrier-specific service code';
{$ENDIF}
end;
procedure TMainForm.rgMaxicode_ModeClick(Sender: TObject);