Стартовый пул
This commit is contained in:
BIN
bgracontrols/test/test_gradientbutton/gradientbutton.ico
Normal file
BIN
bgracontrols/test/test_gradientbutton/gradientbutton.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 134 KiB |
133
bgracontrols/test/test_gradientbutton/gradientbutton.lpi
Normal file
133
bgracontrols/test/test_gradientbutton/gradientbutton.lpi
Normal file
@@ -0,0 +1,133 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="gradientbutton"/>
|
||||
<Scaled Value="True"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<XPManifest>
|
||||
<DpiAware Value="True"/>
|
||||
</XPManifest>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
<BuildModes Count="2">
|
||||
<Item1 Name="Debug" Default="True"/>
|
||||
<Item2 Name="Release">
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="gradientbutton"/>
|
||||
</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>
|
||||
</Item2>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<UseFileFilters Value="True"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes Count="0"/>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="bgracontrols"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="gradientbutton.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="gradientbutton"/>
|
||||
</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>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
22
bgracontrols/test/test_gradientbutton/gradientbutton.lpr
Normal file
22
bgracontrols/test/test_gradientbutton/gradientbutton.lpr
Normal file
@@ -0,0 +1,22 @@
|
||||
program gradientbutton;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, Unit1
|
||||
{ you can add units after this };
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
RequireDerivedFormResource:=True;
|
||||
Application.Scaled:=True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
BIN
bgracontrols/test/test_gradientbutton/image.png
Normal file
BIN
bgracontrols/test/test_gradientbutton/image.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 77 KiB |
38
bgracontrols/test/test_gradientbutton/unit1.lfm
Normal file
38
bgracontrols/test/test_gradientbutton/unit1.lfm
Normal file
@@ -0,0 +1,38 @@
|
||||
object Form1: TForm1
|
||||
Left = 434
|
||||
Height = 240
|
||||
Top = 119
|
||||
Width = 320
|
||||
Caption = 'Gradient Button'
|
||||
ClientHeight = 240
|
||||
ClientWidth = 320
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
LCLVersion = '2.1.0.0'
|
||||
object BCGradientButton1: TBCGradientButton
|
||||
Left = 30
|
||||
Height = 180
|
||||
Top = 30
|
||||
Width = 260
|
||||
DimColor.Red = 0
|
||||
DimColor.Green = 0
|
||||
DimColor.Blue = 0
|
||||
DimColor.Alpha = 100
|
||||
Color1.Red = 255
|
||||
Color1.Green = 255
|
||||
Color1.Blue = 255
|
||||
Color1.Alpha = 100
|
||||
Color2.Red = 0
|
||||
Color2.Green = 0
|
||||
Color2.Blue = 0
|
||||
Color2.Alpha = 0
|
||||
BorderColor.Red = 255
|
||||
BorderColor.Green = 255
|
||||
BorderColor.Blue = 255
|
||||
BorderColor.Alpha = 100
|
||||
BorderSize = 2
|
||||
OnBeforeRedraw = BCGradientButton1BeforeRedraw
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 30
|
||||
end
|
||||
end
|
57
bgracontrols/test/test_gradientbutton/unit1.pas
Normal file
57
bgracontrols/test/test_gradientbutton/unit1.pas
Normal file
@@ -0,0 +1,57 @@
|
||||
unit Unit1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, BCGradientButton,
|
||||
BCButton, BGRABitmap, BCTypes, BGRABitmapTypes;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
BCGradientButton1: TBCGradientButton;
|
||||
procedure BCGradientButton1BeforeRedraw(Sender: TObject; Bitmap: TBGRABitmap
|
||||
);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
private
|
||||
bmp: TBGRABitmap;
|
||||
public
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
BCGradientButton1.BeginUpdate;
|
||||
BCGradientButton1.BorderSize := 4;
|
||||
BCGradientButton1.EndUpdate;
|
||||
bmp := TBGRABitmap.Create(Application.Location + 'image.png');
|
||||
end;
|
||||
|
||||
procedure TForm1.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
bmp.Free;
|
||||
end;
|
||||
|
||||
procedure TForm1.BCGradientButton1BeforeRedraw(Sender: TObject;
|
||||
Bitmap: TBGRABitmap);
|
||||
begin
|
||||
Bitmap.Fill(clNavy);
|
||||
Bitmap.StretchPutImageProportionally(Rect(0, 0, Bitmap.Width, Bitmap.Height), TACenter, TLCenter, bmp, dmDrawWithTransparency);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Reference in New Issue
Block a user