Стартовый пул
This commit is contained in:
156
bgracontrols/test/test_progressbar/test_progressbar.lpi
Normal file
156
bgracontrols/test/test_progressbar/test_progressbar.lpi
Normal file
@@ -0,0 +1,156 @@
|
||||
<?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="test_progressbar"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<BuildModes Count="3">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
<Item2 Name="Debug">
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="test_progressbar"/>
|
||||
</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="Default macOS 64">
|
||||
<MacroValues Count="1">
|
||||
<Macro1 Name="LCLWidgetType" Value="cocoa"/>
|
||||
</MacroValues>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="test_progressbar"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<TargetCPU Value="x86_64"/>
|
||||
<TargetOS Value="darwin"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
</Item3>
|
||||
<SharedMatrixOptions Count="1">
|
||||
<Item1 ID="242000272248" Modes="Default macOS 64" Type="IDEMacro" MacroName="LCLWidgetType" Value="cocoa"/>
|
||||
</SharedMatrixOptions>
|
||||
</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="test_progressbar.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_progressbar"/>
|
||||
</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>
|
21
bgracontrols/test/test_progressbar/test_progressbar.lpr
Normal file
21
bgracontrols/test/test_progressbar/test_progressbar.lpr
Normal file
@@ -0,0 +1,21 @@
|
||||
program test_progressbar;
|
||||
|
||||
{$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.
|
||||
|
148
bgracontrols/test/test_progressbar/umain.lfm
Normal file
148
bgracontrols/test/test_progressbar/umain.lfm
Normal file
@@ -0,0 +1,148 @@
|
||||
object Form1: TForm1
|
||||
Left = 357
|
||||
Height = 240
|
||||
Top = 179
|
||||
Width = 320
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 240
|
||||
ClientWidth = 320
|
||||
LCLVersion = '1.2.6.0'
|
||||
object BGRAFlashProgressBar1: TBGRAFlashProgressBar
|
||||
Left = 8
|
||||
Height = 33
|
||||
Top = 8
|
||||
Width = 307
|
||||
MinValue = 0
|
||||
MaxValue = 100
|
||||
Value = 30
|
||||
OnRedraw = BGRAFlashProgressBar1Redraw
|
||||
Color = 14852966
|
||||
end
|
||||
object BGRAFlashProgressBar2: TBGRAFlashProgressBar
|
||||
Left = 8
|
||||
Height = 33
|
||||
Top = 48
|
||||
Width = 307
|
||||
MinValue = 0
|
||||
MaxValue = 100
|
||||
Value = 30
|
||||
OnClick = BGRAFlashProgressBar2Click
|
||||
OnRedraw = BGRAFlashProgressBar2Redraw
|
||||
Color = 14852966
|
||||
end
|
||||
object BCTrackbarUpdown1: TBCTrackbarUpdown
|
||||
Left = 8
|
||||
Height = 26
|
||||
Top = 96
|
||||
Width = 182
|
||||
BarExponent = 1
|
||||
Increment = 1
|
||||
LongTimeInterval = 400
|
||||
MinValue = 0
|
||||
MaxValue = 100
|
||||
OnChange = BCTrackbarUpdown1Change
|
||||
Value = 50
|
||||
ShortTimeInterval = 100
|
||||
Background.Color = clWindow
|
||||
Background.ColorOpacity = 255
|
||||
Background.Gradient1.StartColor = clWhite
|
||||
Background.Gradient1.StartColorOpacity = 255
|
||||
Background.Gradient1.DrawMode = dmSet
|
||||
Background.Gradient1.EndColor = clBlack
|
||||
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 = clWhite
|
||||
Background.Gradient2.StartColorOpacity = 255
|
||||
Background.Gradient2.DrawMode = dmSet
|
||||
Background.Gradient2.EndColor = clBlack
|
||||
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 = 35
|
||||
Background.Style = bbsColor
|
||||
ButtonBackground.Color = clBlack
|
||||
ButtonBackground.ColorOpacity = 255
|
||||
ButtonBackground.Gradient1.StartColor = clBtnShadow
|
||||
ButtonBackground.Gradient1.StartColorOpacity = 255
|
||||
ButtonBackground.Gradient1.DrawMode = dmSet
|
||||
ButtonBackground.Gradient1.EndColor = clBtnFace
|
||||
ButtonBackground.Gradient1.EndColorOpacity = 255
|
||||
ButtonBackground.Gradient1.ColorCorrection = True
|
||||
ButtonBackground.Gradient1.GradientType = gtLinear
|
||||
ButtonBackground.Gradient1.Point1XPercent = 0
|
||||
ButtonBackground.Gradient1.Point1YPercent = -50
|
||||
ButtonBackground.Gradient1.Point2XPercent = 0
|
||||
ButtonBackground.Gradient1.Point2YPercent = 50
|
||||
ButtonBackground.Gradient1.Sinus = False
|
||||
ButtonBackground.Gradient2.StartColor = clBtnFace
|
||||
ButtonBackground.Gradient2.StartColorOpacity = 255
|
||||
ButtonBackground.Gradient2.DrawMode = dmSet
|
||||
ButtonBackground.Gradient2.EndColor = clBtnShadow
|
||||
ButtonBackground.Gradient2.EndColorOpacity = 255
|
||||
ButtonBackground.Gradient2.ColorCorrection = True
|
||||
ButtonBackground.Gradient2.GradientType = gtLinear
|
||||
ButtonBackground.Gradient2.Point1XPercent = 0
|
||||
ButtonBackground.Gradient2.Point1YPercent = 50
|
||||
ButtonBackground.Gradient2.Point2XPercent = 0
|
||||
ButtonBackground.Gradient2.Point2YPercent = 150
|
||||
ButtonBackground.Gradient2.Sinus = False
|
||||
ButtonBackground.Gradient1EndPercent = 50
|
||||
ButtonBackground.Style = bbsGradient
|
||||
ButtonDownBackground.Color = clBtnShadow
|
||||
ButtonDownBackground.ColorOpacity = 255
|
||||
ButtonDownBackground.Gradient1.StartColor = clWhite
|
||||
ButtonDownBackground.Gradient1.StartColorOpacity = 255
|
||||
ButtonDownBackground.Gradient1.DrawMode = dmSet
|
||||
ButtonDownBackground.Gradient1.EndColor = clBlack
|
||||
ButtonDownBackground.Gradient1.EndColorOpacity = 255
|
||||
ButtonDownBackground.Gradient1.ColorCorrection = True
|
||||
ButtonDownBackground.Gradient1.GradientType = gtLinear
|
||||
ButtonDownBackground.Gradient1.Point1XPercent = 0
|
||||
ButtonDownBackground.Gradient1.Point1YPercent = 0
|
||||
ButtonDownBackground.Gradient1.Point2XPercent = 0
|
||||
ButtonDownBackground.Gradient1.Point2YPercent = 100
|
||||
ButtonDownBackground.Gradient1.Sinus = False
|
||||
ButtonDownBackground.Gradient2.StartColor = clWhite
|
||||
ButtonDownBackground.Gradient2.StartColorOpacity = 255
|
||||
ButtonDownBackground.Gradient2.DrawMode = dmSet
|
||||
ButtonDownBackground.Gradient2.EndColor = clBlack
|
||||
ButtonDownBackground.Gradient2.EndColorOpacity = 255
|
||||
ButtonDownBackground.Gradient2.ColorCorrection = True
|
||||
ButtonDownBackground.Gradient2.GradientType = gtLinear
|
||||
ButtonDownBackground.Gradient2.Point1XPercent = 0
|
||||
ButtonDownBackground.Gradient2.Point1YPercent = 0
|
||||
ButtonDownBackground.Gradient2.Point2XPercent = 0
|
||||
ButtonDownBackground.Gradient2.Point2YPercent = 100
|
||||
ButtonDownBackground.Gradient2.Sinus = False
|
||||
ButtonDownBackground.Gradient1EndPercent = 35
|
||||
ButtonDownBackground.Style = bbsColor
|
||||
Border.Color = clWindowText
|
||||
Border.ColorOpacity = 255
|
||||
Border.LightColor = clWhite
|
||||
Border.LightOpacity = 255
|
||||
Border.LightWidth = 0
|
||||
Border.Style = bboSolid
|
||||
Border.Width = 1
|
||||
Rounding.RoundX = 1
|
||||
Rounding.RoundY = 1
|
||||
Rounding.RoundOptions = []
|
||||
Font.Color = clWindowText
|
||||
Font.Name = 'Arial'
|
||||
HasTrackBar = True
|
||||
ArrowColor = clBtnText
|
||||
TabOrder = 0
|
||||
TabStop = True
|
||||
UseDockManager = False
|
||||
end
|
||||
end
|
73
bgracontrols/test/test_progressbar/umain.pas
Normal file
73
bgracontrols/test/test_progressbar/umain.pas
Normal file
@@ -0,0 +1,73 @@
|
||||
unit umain;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
|
||||
BGRAFlashProgressBar, BCTrackbarUpdown, BGRABitmap, BGRABitmapTypes;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
BCTrackbarUpdown1: TBCTrackbarUpdown;
|
||||
BGRAFlashProgressBar1: TBGRAFlashProgressBar;
|
||||
BGRAFlashProgressBar2: TBGRAFlashProgressBar;
|
||||
procedure BCTrackbarUpdown1Change(Sender: TObject; AByUser: boolean);
|
||||
procedure BGRAFlashProgressBar1Redraw(Sender: TObject; Bitmap: TBGRABitmap;
|
||||
xpos: integer);
|
||||
procedure BGRAFlashProgressBar2Click(Sender: TObject);
|
||||
procedure BGRAFlashProgressBar2Redraw(Sender: TObject; Bitmap: TBGRABitmap;
|
||||
xpos: integer);
|
||||
private
|
||||
{ private declarations }
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
uses BGRATextFX;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.BGRAFlashProgressBar2Redraw(Sender: TObject;
|
||||
Bitmap: TBGRABitmap; xpos: integer);
|
||||
begin
|
||||
{ Draw the progressbar container }
|
||||
Bitmap.Rectangle(0, 0, Bitmap.Width, Bitmap.Height, BGRABlack, BGRAWhite, dmSet);
|
||||
{ Draw the progressbar progress }
|
||||
Bitmap.Rectangle(1, 1, xpos + 1, Bitmap.Height - 1, BGRAWhite, BGRABlack, dmSet);
|
||||
end;
|
||||
|
||||
procedure TForm1.BCTrackbarUpdown1Change(Sender: TObject; AByUser: boolean);
|
||||
begin
|
||||
BGRAFlashProgressBar1.Value := BCTrackbarUpdown1.Value;
|
||||
BGRAFlashProgressBar2.Value := BCTrackbarUpdown1.Value;
|
||||
end;
|
||||
|
||||
procedure TForm1.BGRAFlashProgressBar1Redraw(Sender: TObject;
|
||||
Bitmap: TBGRABitmap; xpos: integer);
|
||||
var fx: TBGRATextEffect;
|
||||
begin
|
||||
fx:= TBGRATextEffect.Create(IntToStr(BGRAFlashProgressBar1.Value)+'%','Arial',BGRAFlashProgressBar1.Height div 2,True);
|
||||
fx.DrawOutline(Bitmap, Bitmap.Width div 2,Bitmap.Height div 4,BGRABlack,taCenter);
|
||||
fx.Draw(Bitmap, Bitmap.Width div 2,Bitmap.Height div 4,BGRAWhite,taCenter);
|
||||
fx.Free;
|
||||
end;
|
||||
|
||||
procedure TForm1.BGRAFlashProgressBar2Click(Sender: TObject);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Reference in New Issue
Block a user