Skip to content

Commit

Permalink
ver.2.4.0 uses Image32 ver.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
carloBarazzetta committed Jul 22, 2021
1 parent 550a3b7 commit fea7ed0
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
Binary file modified Demo/Images/ComponentEditor.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions Packages/SVGIconImageListEditorUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ interface
resourcestring
SELECT_DIR = 'Select directory';
FILES_SAVED = '%d File(s) saved into "%s" folder';
USING_ENGINE = 'Using %s';
ENGINE_HINT = 'Current Active Engine for rendering SVG images';

type
TOpenPictureDialogSvg = class(TOpenPictureDialog)
protected
Expand Down Expand Up @@ -727,6 +730,8 @@ procedure TSVGIconImageListEditor.SVGTextChange(Sender: TObject);
except
on E: Exception do
begin
SVGErrorStaticText.Font.Color := clRed;
SVGErrorStaticText.Font.Style := [fsBold];
SVGErrorStaticText.Caption := E.Message;
SVGErrorStaticText.Hint := E.Message;
SelectedIcon.SVGText := '';
Expand All @@ -739,8 +744,9 @@ procedure TSVGIconImageListEditor.SVGTextChange(Sender: TObject);

procedure TSVGIconImageListEditor.ResetError;
begin
SVGErrorStaticText.Caption := '';
SVGErrorStaticText.Hint := '';
SVGErrorStaticText.Font.Color := clWindowText;
SVGErrorStaticText.Caption := Format(USING_ENGINE, [GetGlobalSVGFactoryDesc]);
SVGErrorStaticText.Hint := ENGINE_HINT;
end;

procedure TSVGIconImageListEditor.SVGTextEnter(Sender: TObject);
Expand Down Expand Up @@ -882,6 +888,7 @@ procedure TSVGIconImageListEditor.FormClose(Sender: TObject;
procedure TSVGIconImageListEditor.FormCreate(Sender: TObject);
begin
inherited;
ResetError;
FEditingList := TSVGIconImageList.Create(Self);
FOpenDialog := TOpenPictureDialogSvg.Create(Self);
FOpenDialog.Filter := 'Scalable Vector Graphics (*.svg)|*.svg';
Expand All @@ -893,8 +900,6 @@ procedure TSVGIconImageListEditor.FormCreate(Sender: TObject);
FModified := False;
SVGText.Font.Name := 'Courier New';
Caption := Format(Caption, [SVGIconImageListVersion]);
SVGErrorStaticText.Font.Color := clRed;
SVGErrorStaticText.Font.Style := [fsBold];
end;

procedure TSVGIconImageListEditor.Apply;
Expand Down
2 changes: 1 addition & 1 deletion Source/FMX.SVGIconImageList.pas
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ interface
;

const
SVGIconImageListVersion = '2.3.1';
SVGIconImageListVersion = '2.4.0';
DEFAULT_SIZE = 32;
ZOOM_DEFAULT = 100;
SVG_INHERIT_COLOR = TAlphaColors.Null;
Expand Down
2 changes: 1 addition & 1 deletion Source/SVGIconImageListBase.pas
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ interface
SvgInterfaces;

const
SVGIconImageListVersion = '2.3.1';
SVGIconImageListVersion = '2.4.0';
DEFAULT_SIZE = 16;

type
Expand Down
17 changes: 17 additions & 0 deletions Source/SVGInterfaces.pas
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ interface

function GlobalSVGFactory: ISVGFactory;
procedure SetGlobalSVGFactory(const SVGFactory : ISVGFactory);
function GetGlobalSVGFactoryDesc: string;

implementation

Expand Down Expand Up @@ -132,4 +133,20 @@ procedure SetGlobalSVGFactory(const SVGFactory : ISVGFactory);
FGlobalSVGFactory := SVGFactory;
end;

function GetGlobalSVGFactoryDesc: string;
begin
{$IFDEF PreferNativeSvgSupport}
if WinSvgSupported then
Result := 'Direct2D Windows Engine'
else
{$ENDIF}
{$IF DEFINED(Delphi_SVGEngine)}
Result := 'Delphi TSVG Engine'
{$ELSEIF DEFINED(Image32_SVGEngine)}
Result := 'Delphi Image32 Engine'
{$ELSEIF DEFINED(Cairo_SVGEngine)}
Result := 'Cairo Engine'
{$ENDIF}
end;

end.

0 comments on commit fea7ed0

Please sign in to comment.