Стартовый пул
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
<?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="circleanimation"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<XPManifest>
|
||||
<DpiAware Value="True"/>
|
||||
</XPManifest>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes Count="1">
|
||||
<Mode0 Name="default"/>
|
||||
</Modes>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="bgracontrols"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="circleanimation.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="circleanimation"/>
|
||||
</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>
|
@@ -0,0 +1,21 @@
|
||||
program circleanimation;
|
||||
|
||||
{$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
|
||||
RequireDerivedFormResource:=True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
@@ -0,0 +1,59 @@
|
||||
object Form1: TForm1
|
||||
Left = 465
|
||||
Height = 343
|
||||
Top = 182
|
||||
Width = 538
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 343
|
||||
ClientWidth = 538
|
||||
Color = clWhite
|
||||
LCLVersion = '1.6.0.4'
|
||||
object Button1: TBGRAGraphicControl
|
||||
Left = 48
|
||||
Height = 57
|
||||
Top = 48
|
||||
Width = 196
|
||||
OnRedraw = Button1Redraw
|
||||
Color = clWhite
|
||||
ColorOpacity = 128
|
||||
Alignment = taCenter
|
||||
OnMouseDown = Button1MouseDown
|
||||
end
|
||||
object BCMaterialDesignButton1: TBCMaterialDesignButton
|
||||
Left = 48
|
||||
Height = 152
|
||||
Top = 112
|
||||
Width = 414
|
||||
TextColor = 8404992
|
||||
TextSize = 22
|
||||
TextStyle = [fsItalic]
|
||||
TextFont = 'default'
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
Caption = 'Material Design'
|
||||
OnClick = BCMaterialDesignButton1Click
|
||||
end
|
||||
object BCMaterialDesignButton2: TBCMaterialDesignButton
|
||||
Left = 458
|
||||
Height = 53
|
||||
Top = 284
|
||||
Width = 66
|
||||
RoundBorders = 25
|
||||
NormalColor = 8404992
|
||||
NormalColorEffect = clWhite
|
||||
ShadowColor = clBlack
|
||||
ShadowSize = 8
|
||||
TextColor = clWhite
|
||||
TextSize = 30
|
||||
TextFont = 'default'
|
||||
Anchors = [akRight, akBottom]
|
||||
Caption = '@'
|
||||
end
|
||||
object Timer1: TTimer
|
||||
Enabled = False
|
||||
Interval = 15
|
||||
OnTimer = Timer1Timer
|
||||
OnStartTimer = Timer1StartTimer
|
||||
left = 28
|
||||
top = 14
|
||||
end
|
||||
end
|
103
bgracontrols/test/test_extra/material_design_animation/umain.pas
Normal file
103
bgracontrols/test/test_extra/material_design_animation/umain.pas
Normal file
@@ -0,0 +1,103 @@
|
||||
unit umain;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, Forms, Controls, ExtCtrls, Dialogs,
|
||||
BGRAGraphicControl, BGRABitmap, BGRABitmapTypes,
|
||||
BGRATextFX, bcmaterialdesignbutton;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
BCMaterialDesignButton1: TBCMaterialDesignButton;
|
||||
BCMaterialDesignButton2: TBCMaterialDesignButton;
|
||||
Button1: TBGRAGraphicControl;
|
||||
Timer1: TTimer;
|
||||
procedure BCMaterialDesignButton1Click(Sender: TObject);
|
||||
procedure Button1MouseDown(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: integer);
|
||||
procedure Button1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
|
||||
procedure Timer1StartTimer(Sender: TObject);
|
||||
procedure Timer1Timer(Sender: TObject);
|
||||
private
|
||||
{ private declarations }
|
||||
public
|
||||
{ public declarations }
|
||||
MouseP: TPoint;
|
||||
CircleX: single;
|
||||
CircleAlpha: byte;
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.Button1MouseDown(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: integer);
|
||||
begin
|
||||
Timer1.Enabled := False;
|
||||
MouseP := Point(X, Y);
|
||||
Timer1.Enabled := True;
|
||||
end;
|
||||
|
||||
procedure TForm1.BCMaterialDesignButton1Click(Sender: TObject);
|
||||
begin
|
||||
//ShowMessage('Click');
|
||||
end;
|
||||
|
||||
procedure TForm1.Button1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
|
||||
var
|
||||
temp: TBGRABitmap;
|
||||
begin
|
||||
{ Shadow }
|
||||
Bitmap.Fill(BGRAPixelTransparent);
|
||||
Bitmap.RoundRect(5, 5, Button1.Width - 5, Button1.Height - 5, 5, 5,
|
||||
BGRA(100, 100, 100), BGRA(100, 100, 100));
|
||||
|
||||
temp := Bitmap.FilterBlurRadial(5, 5, rbFast) as TBGRABitmap;
|
||||
Bitmap.Fill(BGRAPixelTransparent);
|
||||
Bitmap.PutImage(0, 0, temp, dmDrawWithTransparency);
|
||||
temp.Free;
|
||||
|
||||
{ Round Rectangle }
|
||||
temp := TBGRABitmap.Create(Button1.Width, Button1.Height, BGRAWhite);
|
||||
{ Circle Effect }
|
||||
temp.EllipseAntialias(MouseP.X, MouseP.Y, CircleX, CircleX,
|
||||
BGRA(100, 100, 100, CircleAlpha), 1, BGRA(100, 100, 100, CircleAlpha));
|
||||
Bitmap.FillRoundRectAntialias(5, 0, Button1.Width - 5, Button1.Height -
|
||||
5, 5, 5, temp, [rrDefault], False);
|
||||
temp.Free;
|
||||
|
||||
{ Text }
|
||||
temp := TextShadow(Button1.Width, Button1.Height, 'Material Design',
|
||||
20, BGRABlack, BGRABlack, 2, 2, 2) as TBGRABitmap;
|
||||
Bitmap.PutImage(0, 0, temp, dmDrawWithTransparency);
|
||||
temp.Free;
|
||||
end;
|
||||
|
||||
procedure TForm1.Timer1StartTimer(Sender: TObject);
|
||||
begin
|
||||
CircleAlpha := 255;
|
||||
CircleX := 5;
|
||||
end;
|
||||
|
||||
procedure TForm1.Timer1Timer(Sender: TObject);
|
||||
begin
|
||||
CircleX := CircleX + 4;
|
||||
CircleAlpha := CircleAlpha - 5;
|
||||
if CircleAlpha <= 0 then
|
||||
Timer1.Enabled := False;
|
||||
Button1.DiscardBitmap;
|
||||
end;
|
||||
|
||||
end.
|
Reference in New Issue
Block a user