{*********************************************}
{  TAxisScrollTool Editor                     }
{  Copyright (c) 2006-2020 by Steema Software }
{        All Rights Reserved                  }
{*********************************************}
unit TeeAxisScrollEdit;
{$I TeeDefs.inc}

interface

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

  Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
  TeeAxisToolEdit, TeCanvas, TeePenDlg;

type
  TAxisScrollEditor = class(TAxisToolEditor)
    CBInverted: TCheckBox;
    Label2: TLabel;
    CBLimit: TComboFlat;
    procedure FormShow(Sender: TObject);
    procedure CBInvertedClick(Sender: TObject);
    procedure CBLimitChange(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation

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

uses
  TeeTools;

procedure TAxisScrollEditor.FormShow(Sender: TObject);
begin
  inherited;
  BPen.Hide;

  if Assigned(AxisTool) then
  begin
    CBInverted.Checked:=TAxisScrollTool(AxisTool).ScrollInverted;
    CBLimit.ItemIndex:=Ord(TAxisScrollTool(AxisTool).Limit);
  end;
end;

procedure TAxisScrollEditor.CBInvertedClick(Sender: TObject);
begin
  TAxisScrollTool(AxisTool).ScrollInverted:=CBInverted.Checked;
end;

procedure TAxisScrollEditor.CBLimitChange(Sender: TObject);
begin
  TAxisScrollTool(AxisTool).Limit:=TAxisScrollLimit(CBLimit.ItemIndex);
end;

initialization
  RegisterClass(TAxisScrollEditor);
end.
