unit FMXTee.Editor.Tools.ExtraLegend;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMXTee.Editor.Tools.Series,
  FMX.ListBox, FMXTee.Tools.ExtraLegend, FMXTee.Editor.Legend;

type
  TExtraLegendEditor = class(TSeriesToolEditor)
    Panel2: TPanel;
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
    ExtraLegend : TExtraLegendTool;
  public
    { Public declarations }
  end;

implementation

{$R *.fmx}

uses FMXTee.Editor.Stroke, FMXTee.Procs;

procedure TExtraLegendEditor.FormActivate(Sender: TObject);
var
  LegendEditor : TForm;
begin
  inherited;

  if not Assigned(ExtraLegend) then
  begin
    ExtraLegend:=TExtraLegendTool(TagObject);

    if Assigned(ExtraLegend) then
    With ExtraLegend do
    begin
      LegendEditor:=TLegendEditor.CreateEditor(Self, Legend);
      LegendEditor.Name:=TeeGetUniqueName(Self,'LegendEditor');
      EmbeddForm(LegendEditor, Panel2);
    end;
  end;
end;

initialization
  RegisterSeriesEditor(TExtraLegendEditor);
end.
