{********************************************}
{    TActivityGaugeSeries Editor Dialog      }
{ Copyright (c) 1999-2020 by Steema Software }
{********************************************}
unit TeeActivityGaugeEdit;
{$I TeeDefs.inc}

interface

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

     Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,

     Chart, Series, TeeActivityGauge, TeeProcs, TeCanvas;

type
  TActivityGaugeSeriesEditor = class(TForm)
    BBackColor: TButtonColor;
    procedure FormShow(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
    ActivityGauge : TActivityGauge;
    FPieForm : TCustomForm;
  public
    { Public declarations }
  end;

implementation

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

Uses TeeConst, TeeProCo, TeePieEdit, TeeEdiSeri, TeePenDlg, TeeCircledEdit;

procedure TActivityGaugeSeriesEditor.FormShow(Sender: TObject);
begin
  ActivityGauge:=TActivityGauge(Tag);

  if Assigned(ActivityGauge) then
  begin
    if not Assigned(FPieForm) then
    begin
      FPieForm:=TFormTeeSeries.InsertSeriesForm(Parent,TPieSeriesEditor,
                                                 1,TeeMsg_GalleryActivityGauge,
                                                 ActivityGauge);

      TPieSeriesEditor(FPieForm).CheckCircledEditor;
    end;
    BBackColor.LinkProperty(ActivityGauge,'BackColor');
  end;
end;

procedure TActivityGaugeSeriesEditor.FormCreate(Sender: TObject);
begin
  BorderStyle:=TeeBorderStyle;
end;

procedure TActivityGaugeSeriesEditor.FormDestroy(Sender: TObject);
begin
  FreeAndNil(FPieForm);
end;

initialization
  RegisterClass(TActivityGaugeSeriesEditor);
end.
