{**********************************************}
{   TWindRoseSeries Editor dialog              }
{   Copyright (c) 2000-2020 by Steema Software }
{**********************************************}
unit TeeWindRoseEditor;
{$I TeeDefs.inc}

interface

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

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

     TeePolarEditor, TeCanvas, TeePenDlg, TeeRose;

type
  TWindRoseEditor = class(TPolarSeriesEditor)
    CBMirrorAngles: TCheckBox;
    CBMirror: TCheckBox;
    procedure FormCreate(Sender: TObject);
    procedure CBMirrorClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure CBMirrorAnglesClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation

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

procedure TWindRoseEditor.FormCreate(Sender: TObject);
begin
  inherited;
  CBClockWise.Hide; // Visible:=False;
end;

procedure TWindRoseEditor.CBMirrorClick(Sender: TObject);
begin
  (Polar as TWindRoseSeries).MirrorLabels:=CBMirror.Checked;
end;

procedure TWindRoseEditor.FormShow(Sender: TObject);
begin
  inherited;

  if Assigned(Polar) then
  begin
    CBMirror.Checked:=(Polar as TWindRoseSeries).MirrorLabels;
    CBMirrorAngles.Checked:=(Polar as TWindRoseSeries).MirrorAngles;
  end;
end;

procedure TWindRoseEditor.CBMirrorAnglesClick(Sender: TObject);
begin
  (Polar as TWindRoseSeries).MirrorAngles:=CBMirrorAngles.Checked;
end;

initialization
  RegisterClass(TWindRoseEditor);
end.
