Стартовый пул

This commit is contained in:
2024-04-02 08:46:59 +03:00
parent fd57fffd3a
commit 3bb34d000b
5591 changed files with 3291734 additions and 0 deletions

View File

@@ -0,0 +1,362 @@
object Form1: TForm1
Left = 333
Height = 450
Top = 185
Width = 900
Caption = 'SVG Viewer'
ClientHeight = 450
ClientWidth = 900
OnCreate = FormCreate
LCLVersion = '1.6.0.4'
object BCSVGViewer1: TBCSVGViewer
Left = 0
Height = 402
Top = 48
Width = 900
Align = alClient
Color = clWhite
ColorOpacity = 128
Caption = 'BCSVGViewer1'
end
object BCPanel1: TBCPanel
Left = 0
Height = 48
Top = 0
Width = 900
Align = alTop
Background.Color = 5329233
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
BevelInner = bvNone
BevelOuter = bvRaised
BevelWidth = 1
Border.Color = clBlack
Border.ColorOpacity = 255
Border.LightColor = clWhite
Border.LightOpacity = 255
Border.LightWidth = 0
Border.Style = bboNone
Border.Width = 1
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
object BCButton_Open: TBCButton
Left = 8
Height = 33
Top = 8
Width = 123
StateClicked.Background.Color = clBlack
StateClicked.Background.ColorOpacity = 255
StateClicked.Background.Gradient1.StartColor = 6052956
StateClicked.Background.Gradient1.StartColorOpacity = 255
StateClicked.Background.Gradient1.DrawMode = dmSet
StateClicked.Background.Gradient1.EndColor = 6052956
StateClicked.Background.Gradient1.EndColorOpacity = 255
StateClicked.Background.Gradient1.ColorCorrection = True
StateClicked.Background.Gradient1.GradientType = gtLinear
StateClicked.Background.Gradient1.Point1XPercent = 0
StateClicked.Background.Gradient1.Point1YPercent = 0
StateClicked.Background.Gradient1.Point2XPercent = 0
StateClicked.Background.Gradient1.Point2YPercent = 100
StateClicked.Background.Gradient1.Sinus = False
StateClicked.Background.Gradient2.StartColor = 5987163
StateClicked.Background.Gradient2.StartColorOpacity = 255
StateClicked.Background.Gradient2.DrawMode = dmSet
StateClicked.Background.Gradient2.EndColor = 4079166
StateClicked.Background.Gradient2.EndColorOpacity = 255
StateClicked.Background.Gradient2.ColorCorrection = True
StateClicked.Background.Gradient2.GradientType = gtLinear
StateClicked.Background.Gradient2.Point1XPercent = 0
StateClicked.Background.Gradient2.Point1YPercent = 0
StateClicked.Background.Gradient2.Point2XPercent = 0
StateClicked.Background.Gradient2.Point2YPercent = 100
StateClicked.Background.Gradient2.Sinus = False
StateClicked.Background.Gradient1EndPercent = 35
StateClicked.Background.Style = bbsGradient
StateClicked.Border.Color = 1579032
StateClicked.Border.ColorOpacity = 255
StateClicked.Border.LightColor = clBlack
StateClicked.Border.LightOpacity = 100
StateClicked.Border.LightWidth = 1
StateClicked.Border.Style = bboSolid
StateClicked.Border.Width = 1
StateClicked.FontEx.Color = clWhite
StateClicked.FontEx.EndEllipsis = False
StateClicked.FontEx.FontQuality = fqSystemClearType
StateClicked.FontEx.Height = 0
StateClicked.FontEx.SingleLine = True
StateClicked.FontEx.Shadow = True
StateClicked.FontEx.ShadowColor = clBlack
StateClicked.FontEx.ShadowColorOpacity = 255
StateClicked.FontEx.ShadowRadius = 2
StateClicked.FontEx.ShadowOffsetX = 1
StateClicked.FontEx.ShadowOffsetY = 1
StateClicked.FontEx.Style = []
StateClicked.FontEx.TextAlignment = bcaCenter
StateClicked.FontEx.WordBreak = False
StateHover.Background.Color = clBlack
StateHover.Background.ColorOpacity = 255
StateHover.Background.Gradient1.StartColor = 7763574
StateHover.Background.Gradient1.StartColorOpacity = 255
StateHover.Background.Gradient1.DrawMode = dmSet
StateHover.Background.Gradient1.EndColor = 7763574
StateHover.Background.Gradient1.EndColorOpacity = 255
StateHover.Background.Gradient1.ColorCorrection = True
StateHover.Background.Gradient1.GradientType = gtLinear
StateHover.Background.Gradient1.Point1XPercent = 0
StateHover.Background.Gradient1.Point1YPercent = 0
StateHover.Background.Gradient1.Point2XPercent = 0
StateHover.Background.Gradient1.Point2YPercent = 100
StateHover.Background.Gradient1.Sinus = False
StateHover.Background.Gradient2.StartColor = 7697781
StateHover.Background.Gradient2.StartColorOpacity = 255
StateHover.Background.Gradient2.DrawMode = dmSet
StateHover.Background.Gradient2.EndColor = 5329233
StateHover.Background.Gradient2.EndColorOpacity = 255
StateHover.Background.Gradient2.ColorCorrection = True
StateHover.Background.Gradient2.GradientType = gtLinear
StateHover.Background.Gradient2.Point1XPercent = 0
StateHover.Background.Gradient2.Point1YPercent = 0
StateHover.Background.Gradient2.Point2XPercent = 0
StateHover.Background.Gradient2.Point2YPercent = 100
StateHover.Background.Gradient2.Sinus = False
StateHover.Background.Gradient1EndPercent = 35
StateHover.Background.Style = bbsGradient
StateHover.Border.Color = 1579032
StateHover.Border.ColorOpacity = 255
StateHover.Border.LightColor = clWhite
StateHover.Border.LightOpacity = 100
StateHover.Border.LightWidth = 1
StateHover.Border.Style = bboSolid
StateHover.Border.Width = 1
StateHover.FontEx.Color = clWhite
StateHover.FontEx.EndEllipsis = False
StateHover.FontEx.FontQuality = fqSystemClearType
StateHover.FontEx.Height = 0
StateHover.FontEx.SingleLine = True
StateHover.FontEx.Shadow = True
StateHover.FontEx.ShadowColor = clBlack
StateHover.FontEx.ShadowColorOpacity = 255
StateHover.FontEx.ShadowRadius = 2
StateHover.FontEx.ShadowOffsetX = 1
StateHover.FontEx.ShadowOffsetY = 1
StateHover.FontEx.Style = []
StateHover.FontEx.TextAlignment = bcaCenter
StateHover.FontEx.WordBreak = False
StateNormal.Background.Color = clBlack
StateNormal.Background.ColorOpacity = 255
StateNormal.Background.Gradient1.StartColor = 6842472
StateNormal.Background.Gradient1.StartColorOpacity = 255
StateNormal.Background.Gradient1.DrawMode = dmSet
StateNormal.Background.Gradient1.EndColor = 6842472
StateNormal.Background.Gradient1.EndColorOpacity = 255
StateNormal.Background.Gradient1.ColorCorrection = True
StateNormal.Background.Gradient1.GradientType = gtLinear
StateNormal.Background.Gradient1.Point1XPercent = 0
StateNormal.Background.Gradient1.Point1YPercent = 0
StateNormal.Background.Gradient1.Point2XPercent = 0
StateNormal.Background.Gradient1.Point2YPercent = 100
StateNormal.Background.Gradient1.Sinus = False
StateNormal.Background.Gradient2.StartColor = 6776679
StateNormal.Background.Gradient2.StartColorOpacity = 255
StateNormal.Background.Gradient2.DrawMode = dmSet
StateNormal.Background.Gradient2.EndColor = 4671303
StateNormal.Background.Gradient2.EndColorOpacity = 255
StateNormal.Background.Gradient2.ColorCorrection = True
StateNormal.Background.Gradient2.GradientType = gtLinear
StateNormal.Background.Gradient2.Point1XPercent = 0
StateNormal.Background.Gradient2.Point1YPercent = 0
StateNormal.Background.Gradient2.Point2XPercent = 0
StateNormal.Background.Gradient2.Point2YPercent = 100
StateNormal.Background.Gradient2.Sinus = False
StateNormal.Background.Gradient1EndPercent = 35
StateNormal.Background.Style = bbsGradient
StateNormal.Border.Color = 1579032
StateNormal.Border.ColorOpacity = 255
StateNormal.Border.LightColor = clWhite
StateNormal.Border.LightOpacity = 100
StateNormal.Border.LightWidth = 1
StateNormal.Border.Style = bboSolid
StateNormal.Border.Width = 1
StateNormal.FontEx.Color = clWhite
StateNormal.FontEx.EndEllipsis = False
StateNormal.FontEx.FontQuality = fqSystemClearType
StateNormal.FontEx.Height = 0
StateNormal.FontEx.SingleLine = True
StateNormal.FontEx.Shadow = True
StateNormal.FontEx.ShadowColor = clBlack
StateNormal.FontEx.ShadowColorOpacity = 255
StateNormal.FontEx.ShadowRadius = 2
StateNormal.FontEx.ShadowOffsetX = 1
StateNormal.FontEx.ShadowOffsetY = 1
StateNormal.FontEx.Style = []
StateNormal.FontEx.TextAlignment = bcaCenter
StateNormal.FontEx.WordBreak = False
Caption = 'Open'
Color = clNone
DropDownWidth = 16
DropDownArrowSize = 8
GlobalOpacity = 255
InnerMargin = 0
OnClick = BCButton_OpenClick
ParentColor = False
Rounding.RoundX = 1
Rounding.RoundY = 1
Rounding.RoundOptions = [rrTopLeftSquare, rrTopRightSquare, rrBottomRightSquare, rrBottomLeftSquare]
RoundingDropDown.RoundX = 1
RoundingDropDown.RoundY = 1
RoundingDropDown.RoundOptions = [rrTopLeftSquare, rrTopRightSquare, rrBottomRightSquare, rrBottomLeftSquare]
TextApplyGlobalOpacity = False
MemoryUsage = bmuHigh
end
object ComboBox_HorizAlign: TComboBox
Left = 225
Height = 23
Top = 13
Width = 100
ItemHeight = 15
ItemIndex = 1
Items.Strings = (
'Left'
'Center'
'Right'
)
OnChange = ComboBox_HorizAlignChange
Style = csDropDownList
TabOrder = 0
Text = 'Center'
end
object Label1: TLabel
Left = 158
Height = 15
Top = 16
Width = 58
Caption = 'Horizontal:'
Font.Color = clWhite
ParentColor = False
ParentFont = False
end
object ComboBox_VertAlign: TComboBox
Left = 392
Height = 23
Top = 13
Width = 100
ItemHeight = 15
ItemIndex = 1
Items.Strings = (
'Top'
'Center'
'Bottom'
)
OnChange = ComboBox_VertAlignChange
Style = csDropDownList
TabOrder = 1
Text = 'Center'
end
object Label2: TLabel
Left = 336
Height = 15
Top = 16
Width = 41
Caption = 'Vertical:'
Font.Color = clWhite
ParentColor = False
ParentFont = False
end
object ComboBox_StrechMode: TComboBox
Left = 560
Height = 23
Top = 13
Width = 100
ItemHeight = 15
ItemIndex = 1
Items.Strings = (
'None'
'Shrink'
'Stretch'
)
OnChange = ComboBox_StrechModeChange
Style = csDropDownList
TabOrder = 2
Text = 'Shrink'
end
object Label3: TLabel
Left = 504
Height = 15
Top = 16
Width = 40
Caption = 'Stretch:'
Font.Color = clWhite
ParentColor = False
ParentFont = False
end
object CheckBox_Proportional: TCheckBox
Left = 675
Height = 19
Top = 15
Width = 20
Checked = True
Font.Color = clWhite
OnChange = CheckBox_ProportionalChange
ParentFont = False
State = cbChecked
TabOrder = 3
end
object Label4: TLabel
Left = 696
Height = 15
Top = 17
Width = 66
Caption = 'Proportional'
Font.Color = clWhite
ParentColor = False
ParentFont = False
end
end
object OpenDialog1: TOpenDialog
DefaultExt = '.svg'
Filter = 'Fichier SVG (*.svg);*.svg'
left = 337
top = 183
end
end

View File

@@ -0,0 +1,103 @@
unit usvg;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ExtCtrls, BCSVGViewer, BCPanel, BCButton, BCTypes;
type
{ TForm1 }
TForm1 = class(TForm)
BCButton_Open: TBCButton;
BCPanel1: TBCPanel;
BCSVGViewer1: TBCSVGViewer;
CheckBox_Proportional: TCheckBox;
ComboBox_HorizAlign: TComboBox;
ComboBox_VertAlign: TComboBox;
ComboBox_StrechMode: TComboBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
OpenDialog1: TOpenDialog;
procedure BCButton_OpenClick(Sender: TObject);
procedure CheckBox_ProportionalChange(Sender: TObject);
procedure ComboBox_HorizAlignChange(Sender: TObject);
procedure ComboBox_StrechModeChange(Sender: TObject);
procedure ComboBox_VertAlignChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.BCButton_OpenClick(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
try
BCSVGViewer1.LoadFromFile(OpenDialog1.FileName);
except
on ex: Exception do
ShowMessage(ex.Message);
end;
BCSVGViewer1.Invalidate;
end;
end;
procedure TForm1.CheckBox_ProportionalChange(Sender: TObject);
begin
BCSVGViewer1.Proportional := CheckBox_Proportional.Checked;
end;
procedure TForm1.ComboBox_HorizAlignChange(Sender: TObject);
begin
Case ComboBox_HorizAlign.ItemIndex of
0: BCSVGViewer1.HorizAlign:= taLeftJustify;
1: BCSVGViewer1.HorizAlign:= taCenter;
2: BCSVGViewer1.HorizAlign:= taRightJustify;
end;
end;
procedure TForm1.ComboBox_StrechModeChange(Sender: TObject);
begin
Case ComboBox_StrechMode.ItemIndex of
0: BCSVGViewer1.StretchMode:= smNone;
1: BCSVGViewer1.StretchMode:= smShrink;
2: BCSVGViewer1.StretchMode:= smStretch;
end;
end;
procedure TForm1.ComboBox_VertAlignChange(Sender: TObject);
begin
Case ComboBox_VertAlign.ItemIndex of
0: BCSVGViewer1.VertAlign:= tlTop;
1: BCSVGViewer1.VertAlign:= tlCenter;
2: BCSVGViewer1.VertAlign:= tlBottom;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
BCSVGViewer1.StretchMode := smShrink;
BCSVGViewer1.Proportional:= CheckBox_Proportional.Checked;
BCSVGViewer1.DrawCheckers := true;
end;
end.

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="viewer"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<BuildModes Count="3">
<Item1 Name="Debug" Default="True"/>
<Item2 Name="Release">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="viewer"/>
</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>
<Item3 Name="Debug macOS 64">
<MacroValues Count="1">
<Macro1 Name="LCLWidgetType" Value="cocoa"/>
</MacroValues>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="viewer"/>
</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>
</Item3>
<SharedMatrixOptions Count="1">
<Item1 ID="718841172063" Modes="Debug 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="viewer.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="usvg.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="viewer"/>
</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>

View File

@@ -0,0 +1,21 @@
program viewer;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, usvg
{ you can add units after this };
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.