unit FMXTee.Editor.Tools.AxisScroll;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMXTee.Editor.Tools.Axis,
  FMXTee.Procs, FMX.ListBox, FMX.Edit, FMXTee.Tools, FMX.Colors;

type
  TAxisScrollEditor = class(TAxisToolEditor)
    CBInverted: TCheckBox;
    procedure FormActivate(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure CBInvertedChange(Sender: TObject);
  private
    { Private declarations }
    AxisScroll : TAxisScrollTool;
  public
    { Public declarations }
  end;

implementation

{$R *.fmx}

procedure TAxisScrollEditor.CBInvertedChange(Sender: TObject);
begin
  if Assigned(AxisScroll) then
    AxisScroll.ScrollInverted:=CBInverted.IsChecked;
end;

procedure TAxisScrollEditor.FormActivate(Sender: TObject);
begin
  inherited;

  if not Assigned(AxisScroll) then
  begin
    AxisScroll:=TAxisScrollTool(TagObject);

    if Assigned(AxisScroll) then
      CBInverted.IsChecked:=AxisScroll.ScrollInverted;
  end;
end;

procedure TAxisScrollEditor.FormCreate(Sender: TObject);
begin
  inherited;
  BPen.Visible:=False;
end;

initialization
  RegisterSeriesEditor(TAxisScrollEditor);
end.
