{********************************************}
{ TeeChart Pro SVG Canvas and Exporting      }
{ SVG : Scalable Vector Graphics             }
{ www.w3.org/Graphics/SVG                    }
{                                            }
{ Copyright (c) 2001-2020 by Steema Software }
{       All Rights Reserved                  }
{********************************************}
unit TeeSVGCanvasEditor;
{$I TeeDefs.inc}

interface

uses {$IFNDEF LINUX}
     Windows,
     {$ENDIF}
     Classes,

     Graphics, Forms, Controls, StdCtrls,
     {$IFDEF D9}
     Types,
     {$ENDIF}

     TeCanvas, TeeProcs, TeeExport, TeeSVGCanvas;

type
  TSVGOptions = class(TForm)
    CBAntiAlias: TCheckBox;
    Label1: TLabel;
    EDesc: TEdit;
    CBGroup: TCheckBox;
    procedure FormShow(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  private
    { Private declarations }
    SVG : TSVGExportFormat;
  public
    { Public declarations }
  end;

implementation

{$IFNDEF LCL}
{$R *.DFM}
{$ELSE}
{$R *.lfm}
{$ENDIF}

uses
  Clipbrd, SysUtils, TeeConst;

procedure TSVGOptions.FormShow(Sender: TObject);
begin
  if not Assigned(SVG) then
  begin
    SVG:=TSVGExportFormat(Tag);

    if Assigned(SVG) then
    begin
      CBAntiAlias.Checked:=SVG.AntiAlias;
      EDesc.Text:=SVG.SVGDescription;
      CBGroup.Checked:=SVG.Groups;
    end;
  end;
end;

procedure TSVGOptions.FormCloseQuery(Sender: TObject;
  var CanClose: Boolean);
begin
  if Assigned(SVG) then
  begin
    SVG.AntiAlias:=CBAntiAlias.Checked;
    SVG.SVGDescription:=EDesc.Text;
    SVG.Groups:=CBGroup.Checked;
  end;

  CanClose:=True;
end;

initialization
  RegisterClass(TSVGOptions);
finalization
  UnRegisterClass(TSVGOptions);
end.
