LCDDisplay: Restructure example folder. Add CharDefs editor test project.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8318 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-06-19 21:29:11 +00:00
parent 7bf24c3d0b
commit 1c1d9e2c9f
9 changed files with 831 additions and 382 deletions

View File

@ -0,0 +1,159 @@
<?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="CharDefsEditor_Demo"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
</General>
<BuildModes Count="3">
<Item1 Name="Default" Default="True"/>
<Item2 Name="Debug">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="CharDefsEditor_Demo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<IncludeAssertionCode Value="True"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<Checks>
<IOChecks Value="True"/>
<RangeChecks Value="True"/>
<OverflowChecks Value="True"/>
<StackChecks Value="True"/>
</Checks>
<VerifyObjMethodCallValidity Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
<UseHeaptrc Value="True"/>
<TrashVariables Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Release">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="CharDefsEditor_Demo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<Optimizations>
<OptimizationLevel Value="3"/>
</Optimizations>
</CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="False"/>
</Debugging>
<LinkSmart Value="True"/>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
</Item3>
<SharedMatrixOptions Count="1">
<Item1 ID="876422417185" Modes="Default,Debug" Value="-gw3"/>
</SharedMatrixOptions>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="industrial"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
</Item2>
</RequiredPackages>
<Units Count="2">
<Unit0>
<Filename Value="CharDefsEditor_Demo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="untmain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmMain"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="untMain"/>
</Unit1>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="CharDefsEditor_Demo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</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>

View File

@ -0,0 +1,25 @@
program CharDefsEditor_Demo;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
{$IFDEF HASAMIGA}
athreads,
{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, untMain
{ you can add units after this };
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TfrmMain, frmMain);
Application.Run;
end.

View File

@ -0,0 +1,141 @@
object frmMain: TfrmMain
Left = 327
Height = 244
Top = 136
Width = 348
Caption = 'Demo CharDefsEditor'
ClientHeight = 244
ClientWidth = 348
OnCreate = FormCreate
LCLVersion = '2.2.2.0'
object LCDDisplay1: TLCDDisplay
Left = 16
Height = 101
Top = 8
Width = 320
CharDefs.ColCount = 5
CharDefs.RowCount = 7
CharDefs.CharDefs = (
'!,4,4,4,4,4,0,4'
'",10,10,0,0,0,0,0'
'#,0,10,31,10,31,10,0'
'$,4,15,20,14,5,30,4'
'%,25,26,2,4,8,11,19'
'&,12,18,20,8,21,18,13'
''',4,4,0,0,0,0,0'
'(,2,4,8,8,8,4,2'
'),8,4,2,2,2,4,8'
'*,0,4,21,14,21,4,0'
'+,0,4,4,31,4,4,0'
',,0,0,0,0,12,4,8'
'-,0,0,0,14,0,0,0'
'.,0,0,0,0,0,12,12'
'/,1,1,2,4,8,16,16'
'0,14,17,19,21,25,17,14'
'1,4,12,4,4,4,4,14'
'2,14,17,1,2,4,8,31'
'3,14,17,1,6,1,17,14'
'4,2,6,10,18,31,2,2'
'5,31,16,30,1,1,17,14'
'6,14,17,16,30,17,17,14'
'7,31,1,1,2,4,4,4'
'8,14,17,17,14,17,17,14'
'9,14,17,17,15,1,17,14'
':,0,12,12,0,12,12,0'
';,0,12,12,0,12,4,8'
'<,2,4,8,16,8,4,2'
'=,0,0,31,0,31,0,0'
'>,8,4,2,1,2,4,8'
'?,14,17,1,2,4,0,4'
'@,14,17,19,21,23,16,15'
'A,14,17,17,31,17,17,17'
'B,30,17,17,30,17,17,30'
'C,14,17,16,16,16,17,14'
'D,30,17,17,17,17,17,30'
'E,31,16,16,30,16,16,31'
'F,31,16,16,30,16,16,16'
'G,14,17,16,19,17,17,14'
'H,17,17,17,31,17,17,17'
'I,14,4,4,4,4,4,14'
'J,1,1,1,1,17,17,14'
'K,17,18,20,24,20,18,17'
'L,16,16,16,16,16,16,31'
'M,17,27,21,21,17,17,17'
'N,17,25,21,19,17,17,17'
'O,14,17,17,17,17,17,14'
'P,30,17,17,30,16,16,16'
'Q,14,17,17,17,17,14,1'
'R,30,17,17,30,17,17,17'
'S,14,17,16,14,1,17,14'
'T,31,4,4,4,4,4,4'
'U,17,17,17,17,17,17,14'
'V,17,17,17,17,17,10,4'
'W,17,17,17,17,21,27,17'
'X,17,10,4,4,4,10,17'
'Y,17,17,17,10,4,4,4'
'Z,31,1,2,4,8,16,31'
'[,12,8,8,8,8,8,12'
'\,0,16,8,4,2,1,0'
'],6,2,2,2,2,2,6'
'^,4,10,17,0,0,0,0'
'_,0,0,0,0,0,0,31'
'`,6,4,2,0,0,0,0'
'a,0,0,14,1,15,17,15'
'b,16,16,30,17,17,17,30'
'c,0,0,15,16,16,16,15'
'd,1,1,15,17,17,17,15'
'e,0,0,14,17,31,16,14'
'f,3,4,31,4,4,4,4'
'g,0,0,15,17,15,1,14'
'h,16,16,22,25,17,17,17'
'i,4,0,12,4,4,4,14'
'j,2,0,6,2,2,18,12'
'k,16,16,18,20,24,20,18'
'l,12,4,4,4,4,4,14'
'm,0,0,26,21,21,21,21'
'n,0,0,22,25,17,17,17'
'o,0,0,14,17,17,17,14'
'p,0,0,30,17,30,16,16'
'q,0,0,15,17,15,1,1'
'r,0,0,11,12,8,8,8'
's,0,0,14,16,14,1,30'
't,4,4,31,4,4,4,3'
'u,0,0,17,17,17,19,13'
'v,0,0,17,17,17,10,4'
'w,0,0,17,17,21,21,10'
'x,0,0,17,10,4,10,17'
'y,0,0,17,17,15,1,14'
'z,0,0,31,2,4,8,31'
'{,3,4,4,8,4,4,3'
'|,4,4,4,4,4,4,4'
'},24,4,4,2,4,4,24'
'~,8,21,2,0,0,0,0'
'Ä,17,14,17,17,31,17,17'
)
Lines.Strings = (
' '
' '
)
end
object Button1: TButton
Left = 16
Height = 25
Top = 200
Width = 115
AutoSize = True
Caption = 'Open char editor'
OnClick = Button1Click
TabOrder = 0
end
object Memo1: TMemo
Left = 16
Height = 66
Top = 118
Width = 320
Lines.Strings = (
'ABCDefg'
)
OnChange = Memo1Change
TabOrder = 1
end
end

View File

@ -0,0 +1,54 @@
unit untMain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
indLCDDisplay, indLCDDisplay_Editor;
type
{ TfrmMain }
TfrmMain = class(TForm)
Button1: TButton;
LCDDisplay1: TLCDDisplay;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Memo1Change(Sender: TObject);
private
public
end;
var
frmMain: TfrmMain;
implementation
{$R *.lfm}
{ TfrmMain }
procedure TfrmMain.Button1Click(Sender: TObject);
begin
EditCharDefs(LCDDisplay1);
end;
procedure TfrmMain.FormCreate(Sender: TObject);
begin
LCDDisplay1.Lines.Assign(Memo1.Lines);
end;
procedure TfrmMain.Memo1Change(Sender: TObject);
begin
LCDDisplay1.Lines.Assign(Memo1.Lines);
end;
end.

View File

@ -5,7 +5,7 @@
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<Title Value="project1"/>
<Title Value="Properties_Demo"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
@ -21,7 +21,7 @@
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="project1"/>
<Filename Value="Properties_Demo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
@ -62,7 +62,7 @@
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="project1"/>
<Filename Value="Properties_Demo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
@ -107,16 +107,15 @@
</RequiredPackages>
<Units>
<Unit>
<Filename Value="project1.lpr"/>
<Filename Value="Properties_Demo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="untmain.pas"/>
<Filename Value="untMain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmMain"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="untMain"/>
</Unit>
</Units>
</ProjectOptions>
@ -124,7 +123,7 @@
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="project1"/>
<Filename Value="Properties_Demo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>

View File

@ -1,4 +1,4 @@
program project1;
program Properties_Demo;
{$mode objfpc}{$H+}

View File

@ -0,0 +1,420 @@
object frmMain: TfrmMain
Left = 510
Height = 531
Top = 217
Width = 921
AutoSize = True
Caption = 'LCDDisplay Demo'
ClientHeight = 531
ClientWidth = 921
OnCreate = FormCreate
OnShow = FormShow
LCLVersion = '2.3.0.0'
object pnlProperties: TPanel
Left = 0
Height = 194
Top = 337
Width = 921
Align = alBottom
BevelOuter = bvNone
ClientHeight = 194
ClientWidth = 921
TabOrder = 1
object rgFrameStyle: TRadioGroup
Left = 8
Height = 105
Top = 8
Width = 108
AutoFill = True
Caption = 'Frame style'
ChildSizing.LeftRightSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 85
ClientWidth = 104
Items.Strings = (
'fsRelief'
'fsNone'
'fsLowered'
'fsRaised'
)
OnClick = rgFrameStyleClick
TabOrder = 0
end
object rgFrameColorStyle: TRadioGroup
Left = 133
Height = 65
Top = 8
Width = 123
AutoFill = True
Caption = 'Frame color style'
ChildSizing.LeftRightSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 45
ClientWidth = 119
Items.Strings = (
'stWindows'
'stColor'
)
OnClick = rgFrameColorStyleClick
TabOrder = 3
end
object cbtFrameColor: TColorButton
Left = 272
Height = 25
Top = 82
Width = 123
BorderWidth = 2
ButtonColorAutoSize = False
ButtonColorSize = 16
ButtonColor = clBlack
Caption = 'Frame color'
Margin = 8
OnColorChanged = cbtFrameColorColorChanged
end
object rgDotShape: TRadioGroup
Left = 411
Height = 65
Top = 8
Width = 120
AutoFill = True
Caption = 'Dot shape'
ChildSizing.LeftRightSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 45
ClientWidth = 116
Items.Strings = (
'stSquare'
'stRound'
)
OnClick = rgDotShapeClick
TabOrder = 5
end
object mmText: TMemo
AnchorSideTop.Control = lblLinesText
AnchorSideTop.Side = asrBottom
Left = 688
Height = 48
Top = 25
Width = 168
BorderSpacing.Top = 2
BorderSpacing.Right = 8
OnChange = mmTextChange
TabOrder = 13
end
object rgFrameHeight: TRadioGroup
Left = 547
Height = 65
Top = 8
Width = 120
AutoFill = True
Caption = 'Frame height'
ChildSizing.LeftRightSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 45
ClientWidth = 116
Items.Strings = (
'double'
'single'
)
OnClick = rgFrameHeightClick
TabOrder = 8
end
object lblDotSize: TLabel
Left = 411
Height = 15
Top = 85
Width = 44
Caption = 'Dot size:'
Color = clDefault
ParentColor = False
Transparent = False
end
object seDotSize: TSpinEdit
Left = 475
Height = 23
Top = 82
Width = 58
OnChange = seDotSizeChange
TabOrder = 6
end
object lblDotSpace: TLabel
Left = 411
Height = 15
Top = 113
Width = 60
Caption = 'Dots space:'
Color = clDefault
ParentColor = False
Transparent = False
end
object seDotsSpace: TSpinEdit
Left = 475
Height = 23
Top = 110
Width = 58
OnChange = seDotsSpaceChange
TabOrder = 7
end
object lblFrameSize: TLabel
Left = 547
Height = 15
Top = 85
Width = 58
Caption = 'Frame size:'
Color = clDefault
ParentColor = False
Transparent = False
end
object seFrameSize: TSpinEdit
Left = 609
Height = 23
Top = 82
Width = 58
OnChange = seFrameSizeChange
TabOrder = 9
end
object cbAutoSize: TCheckBox
Left = 547
Height = 19
Top = 168
Width = 64
Caption = 'AutoSize'
OnChange = cbAutoSizeChange
TabOrder = 12
end
object cbCharSpace: TCheckBox
Left = 688
Height = 19
Top = 142
Width = 76
Caption = 'Char space'
OnChange = cbCharSpaceChange
TabOrder = 16
end
object cbtBoardColor: TColorButton
Left = 272
Height = 25
Top = 108
Width = 123
BorderWidth = 2
ButtonColorAutoSize = False
ButtonColorSize = 16
ButtonColor = clBlack
Caption = 'Board color'
Margin = 8
OnColorChanged = cbtBoardColorColorChanged
end
object cbtDotONColor: TColorButton
Left = 272
Height = 25
Top = 136
Width = 123
BorderWidth = 2
ButtonColorAutoSize = False
ButtonColorSize = 16
ButtonColor = clBlack
Caption = 'Dot color ON'
Margin = 8
OnColorChanged = cbtDotONColorColorChanged
end
object cbtDotOFFColor: TColorButton
Left = 272
Height = 25
Top = 164
Width = 123
BorderSpacing.Bottom = 8
BorderWidth = 2
ButtonColorAutoSize = False
ButtonColorSize = 16
ButtonColor = clBlack
Caption = 'Dot color OFF'
Margin = 8
OnColorChanged = cbtDotOFFColorColorChanged
end
object seDisplayLineCount: TSpinEdit
Left = 798
Height = 23
Top = 82
Width = 58
OnChange = seDisplayLineCountChange
TabOrder = 14
end
object lblDisplayLineCount: TLabel
Left = 688
Height = 15
Top = 85
Width = 98
Caption = 'Display row count:'
Color = clDefault
ParentColor = False
Transparent = False
end
object seWidth: TSpinEdit
Left = 609
Height = 23
Top = 110
Width = 58
OnChange = seWidthChange
TabOrder = 10
end
object lblWidth: TLabel
Left = 547
Height = 15
Top = 113
Width = 35
Caption = 'Width:'
Color = clDefault
ParentColor = False
Transparent = False
end
object seHeigth: TSpinEdit
Left = 609
Height = 23
Top = 138
Width = 58
OnChange = seHeigthChange
TabOrder = 11
end
object lblHeight: TLabel
Left = 547
Height = 15
Top = 141
Width = 39
Caption = 'Heigth:'
Color = clDefault
ParentColor = False
Transparent = False
end
object lblDisplayCharCount: TLabel
Left = 688
Height = 15
Top = 113
Width = 94
Caption = 'Display col count:'
Color = clDefault
ParentColor = False
Transparent = False
end
object seDisplayCharCount: TSpinEdit
Left = 798
Height = 23
Hint = 'Set 0 for AutoSize'
Top = 112
Width = 58
OnChange = seDisplayCharCountChange
ParentShowHint = False
ShowHint = True
TabOrder = 15
end
object cbColorSchemes: TComboBox
Left = 272
Height = 23
Top = 26
Width = 100
ItemHeight = 15
Items.Strings = (
'csCustom'
'csBlue'
'csGreen'
'csInvGreen'
)
OnChange = cbColorSchemesChange
TabOrder = 4
Text = 'cbColorSchemes'
end
object lblColorScheme: TLabel
Left = 272
Height = 15
Top = 8
Width = 76
Caption = 'Color scheme:'
Color = clDefault
ParentColor = False
Transparent = False
end
object lblCustomColors: TLabel
Left = 272
Height = 15
Top = 64
Width = 119
Caption = 'Custom color scheme:'
Color = clDefault
ParentColor = False
Transparent = False
end
object btnSaveCharDefs: TButton
AnchorSideLeft.Control = rgFrameStyle
AnchorSideRight.Control = rgFrameStyle
AnchorSideRight.Side = asrBottom
Left = 8
Height = 25
Top = 124
Width = 108
Anchors = [akTop, akLeft, akRight]
Caption = 'Save char defs'
OnClick = btnSaveCharDefsClick
TabOrder = 1
end
object btnLoadCharDefs: TButton
AnchorSideLeft.Control = rgFrameStyle
AnchorSideRight.Control = rgFrameStyle
AnchorSideRight.Side = asrBottom
Left = 8
Height = 25
Top = 152
Width = 108
Anchors = [akTop, akLeft, akRight]
AutoSize = True
Caption = 'Load char defs'
OnClick = btnLoadCharDefsClick
TabOrder = 2
end
object lblLinesText: TLabel
Left = 688
Height = 15
Top = 8
Width = 50
Caption = 'Lines text'
end
end
object pnlLCD: TPanel
Left = 0
Height = 333
Top = 0
Width = 921
Align = alClient
AutoSize = True
BevelOuter = bvNone
TabOrder = 0
end
object Bevel1: TBevel
Left = 8
Height = 4
Top = 333
Width = 905
Align = alBottom
BorderSpacing.Left = 8
BorderSpacing.Right = 8
Shape = bsBottomLine
end
end

View File

@ -13,6 +13,7 @@ type
{ TfrmMain }
TfrmMain = class(TForm)
Bevel1: TBevel;
btnSaveCharDefs: TButton;
btnLoadCharDefs: TButton;
cbAutoSize: TCheckBox;
@ -22,16 +23,19 @@ type
cbtDotONColor: TColorButton;
cbtDotOFFColor: TColorButton;
cbColorSchemes: TComboBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
lblDotSize: TLabel;
lblLinesText: TLabel;
lblDotSpace: TLabel;
lblFrameSize: TLabel;
lblDisplayLineCount: TLabel;
lblWidth: TLabel;
lblHeight: TLabel;
lblDisplayCharCount: TLabel;
lblColorScheme: TLabel;
lblCustomColors: TLabel;
mmText: TMemo;
pnlProperties: TPanel;
pnlLCD: TPanel;
rgFrameStyle: TRadioGroup;
rgFrameColorStyle: TRadioGroup;
rgDotShape: TRadioGroup;
@ -103,6 +107,8 @@ begin
end;
procedure TfrmMain.FormCreate(Sender: TObject);
var
i: Integer;
begin
LCDDisplay := TLCDDisplay.Create(self);
with LCDDisplay do
@ -117,8 +123,16 @@ begin
DisplayCharCount := 0;
Lines.Add('TLCDDisplay');
ColorScheme := csInvGreen;
Parent := self;
end
Parent := pnlLCD;
AnchorSideLeft.Control := Parent;
AnchorSideLeft.Side := asrCenter;
BorderSpacing.Around := 6;
end;
// Fix TLabel transparency issue in Laz 2.2.2+
for i := 0 to ComponentCount-1 do
if Components[i] is TLabel then
TLabel(Components[i]).Transparent := true;
end;
procedure TfrmMain.FormShow(Sender: TObject);
@ -177,12 +191,6 @@ end;
procedure TfrmMain.mmTextChange(Sender: TObject);
begin
LCDDisplay.Lines.Assign(mmText.Lines);
if LCDDisplay.AutoSize then
begin
LCDDisplay.InvalidatePreferredSize;
LCDDisplay.AdjustSize;
end;
LCDDisplay.Invalidate;
end;
procedure TfrmMain.rgFrameStyleClick(Sender: TObject);

View File

@ -1,357 +0,0 @@
object frmMain: TfrmMain
Left = 510
Height = 531
Top = 217
Width = 921
Caption = 'LCDDisplay Demo'
ClientHeight = 531
ClientWidth = 921
OnCreate = FormCreate
OnShow = FormShow
LCLVersion = '2.3.0.0'
object rgFrameStyle: TRadioGroup
Left = 24
Height = 105
Top = 336
Width = 108
AutoFill = True
Caption = 'Frame style'
ChildSizing.LeftRightSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 85
ClientWidth = 104
Items.Strings = (
'fsRelief'
'fsNone'
'fsLowered'
'fsRaised'
)
OnClick = rgFrameStyleClick
TabOrder = 0
end
object rgFrameColorStyle: TRadioGroup
Left = 149
Height = 65
Top = 336
Width = 123
AutoFill = True
Caption = 'Frame color style'
ChildSizing.LeftRightSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 45
ClientWidth = 119
Items.Strings = (
'stWindows'
'stColor'
)
OnClick = rgFrameColorStyleClick
TabOrder = 1
end
object cbtFrameColor: TColorButton
Left = 288
Height = 25
Top = 410
Width = 123
BorderWidth = 2
ButtonColorAutoSize = False
ButtonColorSize = 16
ButtonColor = clBlack
Caption = 'Frame color'
Margin = 8
OnColorChanged = cbtFrameColorColorChanged
end
object rgDotShape: TRadioGroup
Left = 427
Height = 65
Top = 336
Width = 120
AutoFill = True
Caption = 'Dot shape'
ChildSizing.LeftRightSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 45
ClientWidth = 116
Items.Strings = (
'stSquare'
'stRound'
)
OnClick = rgDotShapeClick
TabOrder = 2
end
object mmText: TMemo
Left = 704
Height = 65
Top = 336
Width = 168
OnChange = mmTextChange
TabOrder = 3
end
object rgFrameHeight: TRadioGroup
Left = 563
Height = 65
Top = 336
Width = 120
AutoFill = True
Caption = 'Frame height'
ChildSizing.LeftRightSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 45
ClientWidth = 116
Items.Strings = (
'double'
'single'
)
OnClick = rgFrameHeightClick
TabOrder = 4
end
object Label1: TLabel
Left = 427
Height = 15
Top = 413
Width = 44
Caption = 'Dot size:'
Color = clDefault
ParentColor = False
end
object seDotSize: TSpinEdit
Left = 491
Height = 23
Top = 410
Width = 58
OnChange = seDotSizeChange
TabOrder = 5
end
object Label2: TLabel
Left = 427
Height = 15
Top = 441
Width = 60
Caption = 'Dots space:'
Color = clDefault
ParentColor = False
end
object seDotsSpace: TSpinEdit
Left = 491
Height = 23
Top = 438
Width = 58
OnChange = seDotsSpaceChange
TabOrder = 6
end
object Label3: TLabel
Left = 563
Height = 15
Top = 413
Width = 58
Caption = 'Frame size:'
Color = clDefault
ParentColor = False
end
object seFrameSize: TSpinEdit
Left = 625
Height = 23
Top = 410
Width = 58
OnChange = seFrameSizeChange
TabOrder = 7
end
object cbAutoSize: TCheckBox
Left = 149
Height = 19
Top = 413
Width = 64
Caption = 'AutoSize'
OnChange = cbAutoSizeChange
TabOrder = 8
end
object cbCharSpace: TCheckBox
Left = 704
Height = 19
Top = 470
Width = 76
Caption = 'Char space'
OnChange = cbCharSpaceChange
TabOrder = 9
end
object cbtBoardColor: TColorButton
Left = 288
Height = 25
Top = 436
Width = 123
BorderWidth = 2
ButtonColorAutoSize = False
ButtonColorSize = 16
ButtonColor = clBlack
Caption = 'Board color'
Margin = 8
OnColorChanged = cbtBoardColorColorChanged
end
object cbtDotONColor: TColorButton
Left = 288
Height = 25
Top = 464
Width = 123
BorderWidth = 2
ButtonColorAutoSize = False
ButtonColorSize = 16
ButtonColor = clBlack
Caption = 'Dot color ON'
Margin = 8
OnColorChanged = cbtDotONColorColorChanged
end
object cbtDotOFFColor: TColorButton
Left = 288
Height = 25
Top = 492
Width = 123
BorderWidth = 2
ButtonColorAutoSize = False
ButtonColorSize = 16
ButtonColor = clBlack
Caption = 'Dot color OFF'
Margin = 8
OnColorChanged = cbtDotOFFColorColorChanged
end
object seDisplayLineCount: TSpinEdit
Left = 814
Height = 23
Top = 410
Width = 58
OnChange = seDisplayLineCountChange
TabOrder = 10
end
object Label4: TLabel
Left = 704
Height = 15
Top = 413
Width = 95
Caption = 'Screen row count:'
Color = clDefault
ParentColor = False
end
object seWidth: TSpinEdit
Left = 625
Height = 23
Top = 438
Width = 58
OnChange = seWidthChange
TabOrder = 11
end
object Label5: TLabel
Left = 563
Height = 15
Top = 441
Width = 35
Caption = 'Width:'
Color = clDefault
ParentColor = False
end
object seHeigth: TSpinEdit
Left = 625
Height = 23
Top = 466
Width = 58
OnChange = seHeigthChange
TabOrder = 12
end
object Label6: TLabel
Left = 563
Height = 15
Top = 469
Width = 39
Caption = 'Heigth:'
Color = clDefault
ParentColor = False
end
object Label7: TLabel
Left = 704
Height = 15
Top = 441
Width = 91
Caption = 'Screen col count:'
Color = clDefault
ParentColor = False
end
object seDisplayCharCount: TSpinEdit
Left = 814
Height = 23
Top = 438
Width = 58
OnChange = seDisplayCharCountChange
TabOrder = 13
end
object cbColorSchemes: TComboBox
Left = 288
Height = 23
Top = 354
Width = 100
ItemHeight = 15
Items.Strings = (
'csCustom'
'csBlue'
'csGreen'
'csInvGreen'
)
OnChange = cbColorSchemesChange
TabOrder = 14
Text = 'cbColorSchemes'
end
object Label8: TLabel
Left = 288
Height = 15
Top = 336
Width = 76
Caption = 'Color scheme:'
Color = clDefault
ParentColor = False
end
object Label9: TLabel
Left = 288
Height = 15
Top = 392
Width = 119
Caption = 'Custom color scheme:'
Color = clDefault
ParentColor = False
end
object btnSaveCharDefs: TButton
Left = 24
Height = 25
Top = 452
Width = 101
AutoSize = True
Caption = 'Save char defs'
OnClick = btnSaveCharDefsClick
TabOrder = 15
end
object btnLoadCharDefs: TButton
Left = 24
Height = 25
Top = 480
Width = 103
AutoSize = True
Caption = 'Load char defs'
OnClick = btnLoadCharDefsClick
TabOrder = 16
end
end