{*********************************************}
{  TeeChart LiveBindings Registration         }
{  Copyright (c) 2011-2020 by Steema Software }
{  All Rights Reserved                        }
{*********************************************}
unit BindCompVCLTeeReg;
{$I TeeDefs.inc}

interface

// Register TeeChart VCL / FMX LiveBinding classes
procedure Register;

implementation

uses
  System.Classes, System.SysUtils, Data.Bind.Consts, Data.Bind.Components,
  {$IFDEF FMX}
  FMX.Types, FMXTee.Engine,
  FMXTee.Bind.DBLinks, FMXTee.Bind.Editors, FMXTee.Canvas
  {$ELSE}

  // This unit is not accessible in XE5 because dclbindcomp.dcp package is
  // not available in XE5 \Lib\xxx folders
  // BindCompDesign, // <-- fix "Invalid LiveBindings Registration" exception

  Controls, VCLTee.TeEngine,
  VCLTee.Bind.DBLinks, VCLTee.Bind.Editors, VCLTee.TeCanvas
  {$ENDIF}
  ;

procedure Register;
begin
  TeeActivateGroup;

  {$IFDEF FMX}
  GroupDescendentsWith(TCustomBindDBChartLink, TFmxObject);
  {$ELSE}
  GroupDescendentsWith(TCustomBindDBChartLink, TControl);
  {$ENDIF}

  RegisterNoIcon([TBindDBChartLink]);
  RegisterClasses([TBindDBChartLink]);

  try
    RegisterBindComponents(SDataBindingsCategory_DBLinks,[TBindDBChartLink]);
  except
    on E:Exception do
    begin
      ShowMessageUser('Error registering TeeChart LiveBindings: '+#13+E.Message);
    end;
  end;

  //RegisterSelectionEditor(FMXTee.Engine.TChartSeries, TAddDataBindingsPropertyFilter);
  //RegisterDBBindLinkAssociations([TBindDBChartLink],[TCustomChart]);
end;

end.
