{********************************************}
{     TeeChart Pro Charting Library          }
{ Copyright (c) 1995-2020 by Steema Software }
{         All Rights Reserved                }
{********************************************}
unit TeeRVIFuncEditor;
{$I TeeDefs.inc}

interface

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

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

  StatChar, TeCanvas, TeePenDlg, TeeBaseFuncEdit, ExtCtrls;

type
  TRVIFuncEditor = class(TBaseFunctionEditor)
    Label1: TLabel;
    EPeriod: TEdit;
    UDPeriod: TUpDown;
    BSignal: TButtonPen;
    procedure EPeriodChange(Sender: TObject);
  private
    { Private declarations }
  protected
    procedure ApplyFormChanges; override;
    Procedure SetFunction; override;
  public
    { Public declarations }
  end;

implementation

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

uses
  TeEngine, TeeFuncEdit;

procedure TRVIFuncEditor.EPeriodChange(Sender: TObject);
begin
  if Showing then
     EnableApply;
end;

procedure TRVIFuncEditor.ApplyFormChanges;
begin
  inherited;

  IFunction.Period:=UDPeriod.Position;
end;

procedure TRVIFuncEditor.SetFunction;
begin
  inherited;

  with TRVIFunction(IFunction) do
  begin
    UDPeriod.Position:=Round(Period);
    BSignal.LinkPen(SignalPen);
  end;
end;

initialization
  RegisterClass(TRVIFuncEditor);
end.

