Стартовый пул
This commit is contained in:
@@ -0,0 +1,151 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="9"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="BC Numeric Keyboard"/>
|
||||
<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="test_bcnumerickeyboard"/>
|
||||
</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="dsDwarf2Set"/>
|
||||
<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="test_bcnumerickeyboard"/>
|
||||
</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>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="bgracontrols"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="test_bcnumerickeyboard.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="umain.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="test_bcnumerickeyboard"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Options>
|
||||
<LinkerOptions Value="\"/>
|
||||
<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>
|
@@ -0,0 +1,22 @@
|
||||
program test_bcnumerickeyboard;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, umain
|
||||
{ you can add units after this };
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
Application.Title:='BC Numeric Keyboard';
|
||||
RequireDerivedFormResource:=True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
100
bgracontrols/test/test_bcrealnumerickeyboard/umain.lfm
Normal file
100
bgracontrols/test/test_bcrealnumerickeyboard/umain.lfm
Normal file
@@ -0,0 +1,100 @@
|
||||
object Form1: TForm1
|
||||
Left = 442
|
||||
Height = 240
|
||||
Top = 143
|
||||
Width = 516
|
||||
Caption = 'BC Real Numeric Keyboard'
|
||||
ClientHeight = 240
|
||||
ClientWidth = 516
|
||||
OnCreate = FormCreate
|
||||
LCLVersion = '1.7'
|
||||
object BCPanel1: TBCPanel
|
||||
Left = 0
|
||||
Height = 240
|
||||
Top = 0
|
||||
Width = 516
|
||||
Align = alClient
|
||||
Background.Color = clBtnFace
|
||||
Background.ColorOpacity = 255
|
||||
Background.Gradient1.StartColor = clWhite
|
||||
Background.Gradient1.StartColorOpacity = 255
|
||||
Background.Gradient1.DrawMode = dmSet
|
||||
Background.Gradient1.EndColor = 16119285
|
||||
Background.Gradient1.EndColorOpacity = 255
|
||||
Background.Gradient1.ColorCorrection = True
|
||||
Background.Gradient1.GradientType = gtLinear
|
||||
Background.Gradient1.Point1XPercent = 0
|
||||
Background.Gradient1.Point1YPercent = 0
|
||||
Background.Gradient1.Point2XPercent = 0
|
||||
Background.Gradient1.Point2YPercent = 100
|
||||
Background.Gradient1.Sinus = False
|
||||
Background.Gradient2.StartColor = 15722194
|
||||
Background.Gradient2.StartColorOpacity = 255
|
||||
Background.Gradient2.DrawMode = dmSet
|
||||
Background.Gradient2.EndColor = 13137169
|
||||
Background.Gradient2.EndColorOpacity = 255
|
||||
Background.Gradient2.ColorCorrection = True
|
||||
Background.Gradient2.GradientType = gtLinear
|
||||
Background.Gradient2.Point1XPercent = 0
|
||||
Background.Gradient2.Point1YPercent = 0
|
||||
Background.Gradient2.Point2XPercent = 0
|
||||
Background.Gradient2.Point2YPercent = 100
|
||||
Background.Gradient2.Sinus = False
|
||||
Background.Gradient1EndPercent = 100
|
||||
Background.Style = bbsGradient
|
||||
BevelInner = bvNone
|
||||
BevelOuter = bvNone
|
||||
BevelWidth = 1
|
||||
Border.Color = clBlack
|
||||
Border.ColorOpacity = 255
|
||||
Border.LightColor = clWhite
|
||||
Border.LightOpacity = 255
|
||||
Border.LightWidth = 0
|
||||
Border.Style = bboNone
|
||||
Border.Width = 1
|
||||
BorderBCStyle = bpsBorder
|
||||
FontEx.Color = clDefault
|
||||
FontEx.EndEllipsis = False
|
||||
FontEx.FontQuality = fqSystemClearType
|
||||
FontEx.Height = 0
|
||||
FontEx.SingleLine = True
|
||||
FontEx.Shadow = False
|
||||
FontEx.ShadowColor = clBlack
|
||||
FontEx.ShadowColorOpacity = 255
|
||||
FontEx.ShadowRadius = 5
|
||||
FontEx.ShadowOffsetX = 5
|
||||
FontEx.ShadowOffsetY = 5
|
||||
FontEx.Style = []
|
||||
FontEx.TextAlignment = bcaCenter
|
||||
FontEx.WordBreak = False
|
||||
Rounding.RoundX = 1
|
||||
Rounding.RoundY = 1
|
||||
Rounding.RoundOptions = []
|
||||
TabOrder = 0
|
||||
OnClick = FormClick
|
||||
object FloatSpinEdit1: TFloatSpinEdit
|
||||
Left = 8
|
||||
Height = 28
|
||||
Top = 8
|
||||
Width = 76
|
||||
Increment = 1
|
||||
MaxValue = 100000
|
||||
MinValue = 0
|
||||
OnClick = Button1Click
|
||||
TabOrder = 0
|
||||
Value = 0
|
||||
end
|
||||
object Edit1: TEdit
|
||||
Left = 96
|
||||
Height = 28
|
||||
Top = 8
|
||||
Width = 80
|
||||
OnClick = Button1Click
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
||||
object BCRealNumericKeyboard1: TBCRealNumericKeyboard
|
||||
left = 128
|
||||
top = 136
|
||||
end
|
||||
end
|
132
bgracontrols/test/test_bcrealnumerickeyboard/umain.pas
Normal file
132
bgracontrols/test/test_bcrealnumerickeyboard/umain.pas
Normal file
@@ -0,0 +1,132 @@
|
||||
unit umain;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
Spin, BCNumericKeyboard, BCButton, BCTypes, BCPanel, BGRABitmapTypes;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
BCPanel1: TBCPanel;
|
||||
BCRealNumericKeyboard1: TBCRealNumericKeyboard;
|
||||
Edit1: TEdit;
|
||||
FloatSpinEdit1: TFloatSpinEdit;
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure FormClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
private
|
||||
NumericSender: TControl;
|
||||
public
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
{ Button style }
|
||||
procedure BCButtonWindows8(AButton: TBCButton; cl1, cl2: TColor);
|
||||
begin
|
||||
AButton.Rounding.RoundX := 1;
|
||||
AButton.Rounding.RoundY := 1;
|
||||
AButton.RoundingDropDown.Assign(AButton.Rounding);
|
||||
|
||||
with AButton.StateNormal do
|
||||
begin
|
||||
Background.Style := bbsColor;
|
||||
Background.Color := cl1;
|
||||
Border.Style := bboSolid;
|
||||
Border.Width := 1;
|
||||
Border.Color := cl1;
|
||||
Border.LightWidth := 0;
|
||||
Border.LightOpacity := 255;
|
||||
Border.Style := bboSolid;
|
||||
FontEx.Color := clWhite;
|
||||
FontEx.Shadow := False;
|
||||
FontEx.Style := [];
|
||||
end;
|
||||
|
||||
AButton.StateHover.Assign(AButton.StateNormal);
|
||||
AButton.StateClicked.Assign(AButton.StateNormal);
|
||||
|
||||
with AButton.StateHover do
|
||||
begin
|
||||
Background.Color := cl2;
|
||||
Border.Color := cl2;
|
||||
end;
|
||||
|
||||
with AButton.StateClicked do
|
||||
begin
|
||||
Background.Color := cl2;
|
||||
Border.Color := cl2;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.Button1Click(Sender: TObject);
|
||||
begin
|
||||
if (NumericSender <> nil) and (NumericSender.Name = TControl(Sender).Name) and
|
||||
(BCRealNumericKeyboard1.Visible) then
|
||||
begin
|
||||
BCRealNumericKeyboard1.Hide();
|
||||
end
|
||||
else
|
||||
begin
|
||||
NumericSender := Sender as TControl;
|
||||
BCRealNumericKeyboard1.Panel.Left := NumericSender.Left;
|
||||
BCRealNumericKeyboard1.Panel.Top := NumericSender.Top + NumericSender.Height;
|
||||
BCRealNumericKeyboard1.Show();
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormClick(Sender: TObject);
|
||||
begin
|
||||
if NumericSender <> nil then
|
||||
Button1Click(NumericSender);
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
// Assign custom format settings
|
||||
DefaultFormatSettings.CurrencyString := '$';
|
||||
// DefaultFormatSettings.DecimalSeparator := '.';
|
||||
|
||||
// Assign a style
|
||||
BCButtonWindows8(BCRealNumericKeyboard1.ButtonStyle, clGray, clSkyBlue);
|
||||
// Custom extra size inside the button
|
||||
BCRealNumericKeyboard1.ButtonStyle.SetSizeVariables(0, 0, 15, 25);
|
||||
// Apply the style
|
||||
BCRealNumericKeyboard1.UpdateButtonStyle;
|
||||
|
||||
with BCRealNumericKeyboard1.Panel do
|
||||
begin
|
||||
BevelInner := bvNone;
|
||||
BevelOuter := bvNone;
|
||||
Background.Gradient1.StartColor := clNavy;
|
||||
Background.Gradient1.EndColor := clPurple;
|
||||
Background.Gradient1.Point1XPercent := 0;
|
||||
Background.Gradient1.Point1YPercent := 0;
|
||||
Background.Gradient1.Point2XPercent := 0;
|
||||
Background.Gradient1.Point2YPercent := 100;
|
||||
Background.Gradient1EndPercent := 100;
|
||||
Background.Style := bbsGradient;
|
||||
// Spacing around
|
||||
ChildSizing.TopBottomSpacing := 5;
|
||||
ChildSizing.LeftRightSpacing := 5;
|
||||
// Spacing between buttons
|
||||
ChildSizing.VerticalSpacing := 10;
|
||||
ChildSizing.HorizontalSpacing := 10;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
Reference in New Issue
Block a user