{*********************************************}
{  TeeChart Charting Library for FireMonkey   }
{  Copyright (c) 2011-2020 by Steema Software }
{  All Rights Reserved                        }
{*********************************************}
unit FMXTeeChartReg;
{$I TeeDefs.inc}

{$IFNDEF IOS}
{$DEFINE TEEDESIGN}
{$ENDIF}

interface

{$IFDEF TEEDESIGN}
procedure Register;
{$ENDIF}

implementation

uses
  System.Classes, System.SysUtils, System.TypInfo, System.UITypes,

  {$IFDEF TEEDESIGN}
  DsnConst, DesignIntf, DesignEditors, PropertyCategories,

  {$IFNDEF TEENOSERIESDESIGN}
  ColnEdit,
  {$ENDIF}

  {$ENDIF}

  FMXTee.Chart, FMXTee.Chart3D,
  FMX.Types, FMX.Controls,

  {$IFDEF D18}
  FMX.Controls3D,
  {$ENDIF}

  FMX.Forms, FMXTee.Engine, FMXTee.About, FMX.Dialogs, FMXTee.Procs,
  FMXTee.Constants, FMXTee.Canvas,

  {$IFNDEF TEELITEEMB}
  FMX.Types3D, FMXTee.Animations,

  FMXTee.DBChart, FMXTee.Dataset, FMXTee.Chart.Crosstab, FMXTee.Editor.Tools,
  FMXTee.Editor.Export, FMXTee.Print.Preview, FMXTee.Chart.Functions,
  FMXTee.Editor.DB, FMXTee.Editor.DBSource, FMXTee.Editor.DBSummary,
  FMXTee.Editor.DBChart, FMXTee.Editor.CrossTab, Data.DB,
  FMXTee.Editor.Chart3D,
  {$ENDIF}

  FMXTee.Editor.Chart, FMXTee.Editor.Stroke, FMXTee.RadioGroup,
  FMXTee.Editor.Legend, FMXTee.Editor.Axis, FMXTee.Editor.Aspect,
  FMXTee.Editor.Title, FMXTee.Editor.Wall, FMXTee.Editor.Series.Pointer,
  FMXTee.Editor.Brush, FMXTee.Editor.Gradient, FMXTee.Editor.Series,
  FMXTee.Editor.Shadow, FMXTee.Editor.CustomShape;

{$R TeeChart.res}


{$IFDEF TEEDESIGN}
type
  TChartCompEditor=class(TComponentEditor)
  protected
    Function Chart:TCustomChart; virtual;
  public
    procedure Edit; override;
    procedure ExecuteVerb( Index : Integer ); override;
    function GetVerbCount : Integer; override;
    function GetVerb( Index : Integer ) : string; override;
  end;

  TChart3DCompEditor=class(TChartCompEditor)
  protected
    Function Chart:TCustomChart; override;
  end;

  TTeeClassProperty=class(TClassProperty)
  protected
    function GetObject:Integer;
  public
    function GetValue: string; override;
  end;

  TChartClassProperty=class(TTeeClassProperty)
  public
    function GetAttributes : TPropertyAttributes; override;
  end;

  {$IFNDEF TEELITEEMB}
  TDBChartCompEditor=class(TChartCompEditor)
  public
    procedure ExecuteVerb( Index : Integer ); override;
    function GetVerbCount : Integer; override;
    function GetVerb( Index : Integer ) : string; override;
  end;

  TChartToolsProperty=class(TTeeClassProperty)
  public
    procedure Edit; override;
    function GetAttributes : TPropertyAttributes; override;
  end;

  TCrosstabFieldProperty=class(TStringProperty)
  public
    function GetAttributes : TPropertyAttributes; override;
    procedure GetValues(Proc: TGetStrProc); override;
  end;

  TCrossTabCompEditor=class(TComponentEditor)
  private
    function HasSeries:Boolean;
  public
    procedure ExecuteVerb( Index : Integer ); override;
    function GetVerbCount : Integer; override;
    function GetVerb( Index : Integer ) : string; override;
  end;

  TControl3DCompEditor=class(TComponentEditor)
  public
    procedure Edit; override;
    procedure ExecuteVerb( Index : Integer ); override;
    function GetVerbCount : Integer; override;
    function GetVerb( Index : Integer ) : string; override;
  end;
  {$ENDIF}

  TChartSeriesEditor=class(TComponentEditor)
  public
    procedure Edit; override;
    procedure ExecuteVerb( Index : Integer ); override;
    function GetVerbCount : Integer; override;
    function GetVerb( Index : Integer ) : string; override;
  end;

  TChartPenProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

  TChartBrushProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

  TChartLegendProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

  TChartAxisProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

  TChartAxisTitleProperty=class(TTeeClassProperty)
  public
    function GetAttributes : TPropertyAttributes; override;
  end;

  TCustomSeriesListProperty=class(TTeeClassProperty)
  public
    procedure Edit; override;
    function GetAttributes : TPropertyAttributes; override;
  end;

  TSeriesPointerProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

  TChartTitleProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

  TChartWallProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

  TChartGradientProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

  TTeeShadowProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

  TTeeCustomShapeProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

  TTeeEmbossProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

  TSeriesMarksProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

  TView3DOptionsProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

  TChart3DChartProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

  TChartPageProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

  TCustomAxesProperty=class(TTeeClassProperty)
  public
    procedure Edit; override;
    function GetAttributes: TPropertyAttributes; override;
  end;

procedure EditChartDesign(const Chart:TCustomChart);
begin
  TChartEditForm.Edit(Application, Chart);
end;

{$IFNDEF TEELITEEMB}
procedure ChartPreview(Sender:TComponent; Chart:TCustomChart);
begin
  TChartPreview.Preview(Application, Chart);
end;

procedure TeeExport(Sender:TComponent; Chart:TCustomChart);
begin
  TExportEditor.Edit(Application, Chart);
end;
{$ENDIF}

type
  TTeeDesigner=IDesigner;
  TTeeEditSeriesProc=procedure(ASeries:TChartSeries; ADesigner:TTeeDesigner);
  TTeeChartEditorHook=procedure(ADesigner: TTeeDesigner;
                                AList: TCustomSeriesList;
                                EditSeriesProc: TTeeEditSeriesProc;
                                AGroup: TSeriesGroup=nil);

  TTeeDesignOptionsHook=procedure;

procedure EditSeriesProc(ASeries:TChartSeries; ADesigner:TTeeDesigner);
begin
  TChartEditForm.Edit(Application, ASeries);

  if Assigned(ADesigner) then
     ADesigner.Modified{$IFDEF LCL}(ASeries){$ENDIF};
end;

Var
  TeeChartEditorHook   : TTeeChartEditorHook=nil;
  TeeDesignOptionsHook : TTeeDesignOptionsHook=nil;

{ TChartCompEditor }

Function TChartCompEditor.Chart:TCustomChart;
begin
  result:=TCustomChart(Component);
end;

procedure TChartCompEditor.Edit;
begin
  EditChartDesign(Chart);
  Designer.Modified;
end;

procedure TChartCompEditor.ExecuteVerb( Index : Integer );
begin
  Case Index of
    0..3: TFormAbout.About(Application);
    4: Edit;

  {$IFNDEF TEELITEEMB}
    5: ChartPreview(Application,Chart);
    6: TeeExport(Application,Chart);
  else
  begin
   case Index of
   {$IFDEF TEESHOWCUSTOMAXES}
    7: ShowCollectionEditor(Designer,Chart,Chart.CustomAxes,'CustomAxes'); // Do not localize
    8: if Assigned(TeeDesignOptionsHook) then TeeDesignOptionsHook;
   {$ELSE}
    7: if Assigned(TeeDesignOptionsHook) then TeeDesignOptionsHook;
   {$ENDIF}
   else
     inherited;
   end;
  end;
  {$ENDIF}

  end;
end;

function TChartCompEditor.GetVerbCount : Integer;
begin
  Result:=inherited GetVerbCount+{$IFDEF TEESHOWCUSTOMAXES}8{$ELSE}{$IFDEF TEELITEEMB}5{$ELSE}7{$ENDIF}{$ENDIF};
  if Assigned(TeeChartEditorHook) then Inc(result);
  if Assigned(TeeDesignOptionsHook) then Inc(result);
end;

function TChartCompEditor.GetVerb( Index : Integer ) : string;
begin
  result:='';
  Case Index of
    0: begin
         result:=TeeMsg_Version;
         if TeeIsTrial then result:=result+' TRIAL'; // Do not localize
       end;

    1: result:=TeeMsg_Copyright;
    2: result:='-';
    3: result:=TeeMsg_About;
    4: result:=TeeMsg_EditChart;

  {$IFNDEF TEELITEEMB}
    5: result:=TeeMsg_PrintPreview;
    6: result:=TeeMsg_ExportChart;
   else
   begin
     case Index of
        7: result:=TeeMsg_CustomAxes;
        8: if Assigned(TeeChartEditorHook) then result:=TeeMsg_SeriesList
                                           else result:=TeeMsg_Options;
        9: result:=TeeMsg_Options;
     end;
   end;
  {$ENDIF}
  end;
end;

{ Series Editor }

procedure TChartSeriesEditor.Edit;
begin
  EditSeriesProc(TChartSeries(Component),Designer);
end;

procedure TChartSeriesEditor.ExecuteVerb( Index : Integer );
begin
  if Index=0 then Edit else inherited;
end;

function TChartSeriesEditor.GetVerbCount : Integer;
begin
  result:=inherited GetVerbCount+1;
end;

function TChartSeriesEditor.GetVerb( Index : Integer ) : string;
begin
  if Index=0 then result:=TeeMsg_Edit
             else result:=inherited GetVerb(Index);
end;

{$IFNDEF TEELITEEMB}
{ DBChart Editor }

procedure TDBChartCompEditor.ExecuteVerb( Index : Integer );
begin
  if Index+1=GetVerbCount then TCustomDBChart(Component).RefreshData
                          else inherited;
end;

function TDBChartCompEditor.GetVerbCount : Integer;
begin
  Result := inherited GetVerbCount+1;
end;

function TDBChartCompEditor.GetVerb( Index : Integer ) : string;
begin
  if Index+1=GetVerbCount then result:=TeeMsg_RefreshData
                          else result:=inherited GetVerb(Index);
end;

{ Chart Tools Editor }
procedure TChartToolsProperty.Edit;
var AChart : TCustomChart;
begin
  AChart:=TCustomChart(TChartTools(GetObject).Owner);

  if AChart.Tools.Count>0 then
     with TToolsEditor.CreateEditor(Application, AChart) do
     try
       ShowModal;
     finally
       Free;
     end
  else
     TChartEditForm.Edit(Application, AChart);

  Designer.Modified;
end;

function TChartToolsProperty.GetAttributes : TPropertyAttributes;
begin
  Result := [paDialog];
end;

{ TCrosstabField Property }
function TCrosstabFieldProperty.GetAttributes : TPropertyAttributes;
Begin
  result:=inherited GetAttributes+[paValueList];
end;

procedure TCrosstabFieldProperty.GetValues(Proc: TGetStrProc);
var Crosstab : TDBCrossTabSource;
begin
  Crosstab:=TDBCrossTabSource(GetComponent(0));
  if Assigned(Crosstab.DataSet) then FillDataSetFields(Crosstab.DataSet,Proc);
end;

{ TCrossTabCompEditor }
procedure TCrossTabCompEditor.ExecuteVerb(Index:Integer);
begin
  (*
  if (Index=0) and HasSeries then
  with TDBChartCrossTabEditor.Create(Application) do
  try
    Tag:=NativeInt(TDBCrossTabSource(Component).Series);
    PanelButtons.Show;

    Align:=alNone;
    Position:=poScreenCenter;

    ShowModal;

    Self.Designer.Modified;
  finally
  end
  else*) inherited;
end;

function TCrossTabCompEditor.GetVerbCount:Integer;
begin
  result:=inherited GetVerbCount;
  if HasSeries then Inc(result);
end;

function TCrossTabCompEditor.GetVerb(Index:Integer):string;
begin
  if (Index=0) and HasSeries then
     result:=TeeMsg_Edit
  else
     result:=inherited GetVerb(Index);
end;

function TCrossTabCompEditor.HasSeries:Boolean;
begin
  result:=Assigned(TDBCrossTabSource(Component).Series);
end;

{ TControl3DCompEditor }

procedure TControl3DCompEditor.Edit;
begin
  TChart3DEditor.Edit(Application, TControl3D(Component));
  Designer.Modified;
end;

procedure TControl3DCompEditor.ExecuteVerb( Index : Integer );
begin
  if Index=0 then
     Edit
  else
     inherited;
end;

function TControl3DCompEditor.GetVerbCount : Integer;
begin
  result:=inherited GetVerbCount+1;
end;

function TControl3DCompEditor.GetVerb( Index : Integer ) : string;
begin
  if Index=0 then
     result:=TeeMsg_Edit
  else
     result:=inherited GetVerb(Index);
end;

{$ENDIF}

{ TChartClassProperty }

function TChartClassProperty.GetAttributes: TPropertyAttributes;
begin
  Result := [paSubProperties,paDialog];
end;

{ TChartPenProperty }

procedure TChartPenProperty.Edit;
begin
  if TStrokeEditor.Edit(Application, TChartPen(GetObject)) then
     Designer.Modified;
end;

{ TTeeClassProperty }

function TTeeClassProperty.GetObject: Integer;
begin
  result:=GetOrdValue;
end;

function TTeeClassProperty.GetValue: string;
begin
  FmtStr(Result, '(%s)', [GetPropType^.Name]); // Do not localize
end;

{ Chart Legend Editor }
procedure TChartLegendProperty.Edit;
begin
  with TLegendEditor.CreateEditor(Application, TChartLegend(GetObject)) do
  try
    if ShowModal=mrOk then
      Designer.Modified;
  finally
    Free;
  end;
end;

{ Axis Chart Editor }
procedure TChartAxisProperty.Edit;
begin
  with TAxisEditor.CreateEditor(Application, TChartAxis(GetObject).ParentChart.Axes) do
  try
    RefreshAxis(TChartAxis(GetObject));

    if ShowModal=mrOk then
      Designer.Modified;
  finally
    Free;
  end;
end;

{ Series list Editor (used by Chart1.SeriesList and TSeriesGroup.Series properties) }
function TCustomSeriesListProperty.GetAttributes: TPropertyAttributes;
begin
  Result := [paDialog];
end;

procedure TCustomSeriesListProperty.Edit;
var AList : TCustomSeriesList;
begin
  AList:=TCustomSeriesList(GetObject);

  TChartEditForm.Edit(Application, AList.Owner as TCustomChart);
  Designer.Modified;
end;

{ Chart Axis Title Editor }
function TChartAxisTitleProperty.GetAttributes: TPropertyAttributes;
begin
  Result := [paSubProperties];
end;

{ Chart Title Editor }
procedure TChartTitleProperty.Edit;
begin
  with TTitleEditor.CreateEditor(Application, TChartTitle(GetObject)) do
  try
    if ShowModal=mrOk then
      Designer.Modified;
  finally
    Free;
  end;
end;

{ Chart Wall Editor }
procedure TChartWallProperty.Edit;
begin
  with TWallEditor.CreateEditor(Application, TChartWall(GetObject)) do
  try
    if ShowModal=mrOk then
      Designer.Modified;
  finally
    Free;
  end;
end;

{ Series Pointer Editor }
procedure TSeriesPointerProperty.Edit;
begin
  if TSeriesPointerEditor.Edit(Application, TSeriesPointer(GetObject)) then
     Designer.Modified;
end;

{ ChartBrush Editor }
procedure TChartBrushProperty.Edit;
begin
  if TBrushEditor.Edit(Application, TChartBrush(GetObject)) then
     Designer.Modified;
end;

{ TChartPage editor }

type
  TChartEditorAccess=class(TChartEditForm);

procedure TChartPageProperty.Edit;
var tmp : TChartEditForm;
  chartP: TChartPage;
begin
  chartP:=TChartPage(GetObject);

  tmp:=TChartEditForm.Create(Application);
  with TChartEditorAccess(tmp) do
  try
    SetupChart(TCustomChart(chartP.Parent));
    Tree.Selected:=PagingNode;
    if ShowModal=mrOk then
      Designer.Modified;
  finally
    Free;
  end;
end;

{ TCustomAxesProperty }

procedure TCustomAxesProperty.Edit;
var tmp : TChartAxis;
    tmpColl : TOwnedCollection;
begin
  tmpColl:=TOwnedCollection(GetObject);

  {$IFDEF D7}
  tmp:=TChartAxis(tmpColl.Owner);
  {$ELSE}
  tmp:=TChartAxis(TOwnedCollectionAccess(tmpColl).GetOwner);
  {$ENDIF}

  if Assigned(tmp) then
     ShowCollectionEditor(Designer,tmp.ParentChart,tmp.SubAxes,'SubAxes'); // Do not localize
end;

function TCustomAxesProperty.GetAttributes: TPropertyAttributes;
begin
  Result := [paDialog, paReadOnly];
end;

{ Chart Series Marks Editor }
procedure TSeriesMarksProperty.Edit;
var ASeriesMarks : TSeriesMarks;
begin
  ASeriesMarks:=TSeriesMarks(GetObject);

  if Assigned(ASeriesMarks) then
  begin
    TSeriesEditor.EditMarks(Application, ASeriesMarks);
    Designer.Modified;
  end;
end;

{ Gradient Editor }
procedure TChartGradientProperty.Edit;
begin
  if TGradientEditor.Edit(Application, TCustomTeeGradient(GetObject)) then
     Designer.Modified;
end;

{ TTeeShadowProperty }
procedure TTeeShadowProperty.Edit;
begin
  if TShadowEditor.Edit(Application, TTeeShadow(GetObject)) then
     Designer.Modified;
end;

{ TTeeCustomShapeProperty }
procedure TTeeCustomShapeProperty.Edit;
begin
  if TTeeShapeEditor.Edit(Application,TTeeCustomShape(GetObject)) then
     Designer.Modified;
end;

{ TTeeEmbossProperty }
procedure TTeeEmbossProperty.Edit;
begin
  if TShadowEditor.Edit(Application, TTeeEmboss(GetObject)) then
     Designer.Modified;
end;

{ TView3DOptionsProperty }
procedure TView3DOptionsProperty.Edit;
var tmp : TChartEditForm;
    view3d: TView3DOptions;
begin
  view3d:=TView3DOptions(GetObject);

  tmp:=TChartEditForm.Create(Application);
  with TChartEditorAccess(tmp) do
  try
    SetupChart(TCustomChart(view3d.Parent));

    Tree.Selected:=Node3D;

    if ShowModal=mrOk then
       Designer.Modified;
  finally
    Free;
  end;
end;

{ TChart3DChartProperty }
procedure TChart3DChartProperty.Edit;
begin
  TChartEditForm.Edit(Application, TCustomChart3D(GetObject).Chart);
end;

{ TSeriesDataSource Property }
type
  TSeriesDataSourceProperty = class(TComponentProperty)
  private
    FAddDataSetProc:TGetStrProc;
    procedure AddDataSource(Const S:String);
  public
    procedure GetValues(Proc: TGetStrProc); override;
  end;

procedure TSeriesDataSourceProperty.AddDataSource(Const S:String);
var tmpSeries : TChartSeries;
    tmpComp   : TComponent;
begin
  if S<>'' then
  begin
    tmpComp:=Designer.GetComponent(S);

    if Assigned(tmpComp) then
    begin
      tmpSeries:=TChartSeries(GetComponent(0));
      if tmpSeries.ParentChart.IsValidDataSource(tmpSeries,tmpComp) then
         FAddDataSetProc(S);
    end;
  end;
end;

procedure TSeriesDataSourceProperty.GetValues(Proc: TGetStrProc);
begin
  if Assigned(TChartSeries(GetComponent(0)).ParentChart) then
  Begin
    FAddDataSetProc:=Proc;

    {$IFNDEF TEELITEEMB}
    Designer.GetComponentNames(GetTypeData(TDataSource.ClassInfo),AddDataSource);
    Designer.GetComponentNames(GetTypeData(TDataSet.ClassInfo),AddDataSource);
    {$ENDIF}
    
    Designer.GetComponentNames(GetTypeData(TChartSeries.ClassInfo),AddDataSource);
    Designer.GetComponentNames(GetTypeData(TTeeSeriesSource.ClassInfo),AddDataSource);
  end;
end;

{ TValueSource Property }
type
  TValueSourceProperty=class(TStringProperty)
  public
    function GetAttributes : TPropertyAttributes; override;
    procedure GetValues(Proc: TGetStrProc); override;
  end;

function TValueSourceProperty.GetAttributes : TPropertyAttributes;
Begin
  result:=inherited GetAttributes+[paValueList];
end;

procedure TValueSourceProperty.GetValues(Proc: TGetStrProc);
Var AValueList : TChartValueList;
begin
  AValueList:=TChartValueList(GetComponent(0));

  With AValueList.Owner do
  if Assigned(ParentChart) then
      TCustomChart(ParentChart).FillValueSourceItems(AValueList,Proc);
end;

{ TSeriesSource Property }
type
  TSeriesSourceProperty=class(TStringProperty)
  public
    function GetAttributes : TPropertyAttributes; override;
    procedure GetValues(Proc: TGetStrProc); override;
  end;

procedure TSeriesSourceProperty.GetValues(Proc: TGetStrProc);
Var ASeries : TChartSeries;
begin
  ASeries:=TChartSeries(GetComponent(0));
  With ASeries do
  if Assigned(ParentChart) then
     TCustomChart(ParentChart).FillSeriesSourceItems(ASeries,Proc);
end;

function TSeriesSourceProperty.GetAttributes : TPropertyAttributes;
Begin
  result:=inherited GetAttributes+[paValueList];
end;

{ TChart3DCompEditor }
function TChart3DCompEditor.Chart: TCustomChart;
begin
  result:=TCustomChart3D(Component).Chart;
end;

procedure Register;
begin
  TeeActivateGroup;

  RegisterNoIcon([ TCustomChartElement, TTeeFunction ]);

  RegisterComponents(TeeMsg_TeeChartPalette, [TChart, TChart3D]);

  RegisterComponentEditor(TCustomChart, TChartCompEditor);
  RegisterComponentEditor(TCustomChart3D, TChart3DCompEditor);
  RegisterComponentEditor(TChartSeries, TChartSeriesEditor);

  {$IFNDEF TEELITEEMB}
  //RegisterComponentEditor(TControl3D, TControl3DCompEditor); // <-- Produces wrong right-click menu for TChart3D
  RegisterComponents(TeeMsg_TeeChartPalette, [TRadioGroup, TIntegerAnimation,
                           TSequenceAnimation, TChildrenAnimation, TLine3D] );
  {$ENDIF}

  RegisterPropertyEditor(TypeInfo(TCustomChart),TCustomChart3D,
                         'Chart', TChart3DChartProperty); // Do not localize

  RegisterPropertyEditor(TypeInfo(TChartPen), nil, '',TChartPenProperty);

  {$IFNDEF TEELITEEMB}
  GroupDescendentsWith(TTeeDataSet,TFmxObject);

  RegisterComponents(TeeMsg_TeeChartPalette, [TDBChart,TRadioGroup]);

  RegisterComponents( TeeMsg_TeeChartPalette,
                      [ TSeriesDataSet,
                        TChartDataSet,
                        TDBCrossTabSource ] );

  RegisterPropertyEditor(TypeInfo(TChartTools), TCustomChart, 'Tools', // Do not localize
                         TChartToolsProperty);

  RegisterPropertyEditor(TypeInfo(String),
                         TDBCrossTabSource,'GroupField',TCrosstabFieldProperty); // Do not localize

  RegisterPropertyEditor(TypeInfo(String),
                         TDBCrossTabSource,'LabelField',TCrosstabFieldProperty); // Do not localize

  RegisterPropertyEditor(TypeInfo(String),
                         TDBCrossTabSource,'ValueField',TCrosstabFieldProperty); // Do not localize

  {$ENDIF}

  RegisterFmxClasses([TRadioGroup]);

  RegisterPropertyEditor(TypeInfo(TSeriesMarks),TChartSeries,
                         'Marks', TSeriesMarksProperty); // Do not localize

  RegisterPropertyEditor(TypeInfo(TSeriesPointer),nil,'',TSeriesPointerProperty);

  RegisterPropertyEditor(TypeInfo(TChartWall),nil,'',TChartWallProperty);

  RegisterPropertyEditor(TypeInfo(TChartTitle),TCustomChart,'', TChartTitleProperty);

  RegisterPropertyEditor(TypeInfo(TCustomChartLegend),TCustomChart,
                         'Legend', TChartLegendProperty); // Do not localize

  RegisterPropertyEditor(TypeInfo(TChartAxis),TCustomChart,'', TChartAxisProperty);

  RegisterPropertyEditor(TypeInfo(TCustomSeriesList), nil, '',
                         TCustomSeriesListProperty);

  RegisterPropertyEditor(TypeInfo(TChartAxisTitle), TChartAxis, 'Title', // Do not localize
                         TChartAxisTitleProperty);

  RegisterPropertyEditor(TypeInfo(TCustomTeeGradient),nil,'', TChartGradientProperty);

  RegisterPropertyEditor(TypeInfo(TTeeCustomShape),nil,'',TTeeCustomShapeProperty);

  RegisterPropertyEditor(TypeInfo(TTeeShadow),nil,'', TTeeShadowProperty);

  RegisterPropertyEditor(TypeInfo(TComponent),
                         TChartSeries,'DataSource',TSeriesDataSourceProperty); // Do not localize

  RegisterPropertyEditor(TypeInfo(String),
                         TChartValueList,'ValueSource',TValueSourceProperty); // Do not localize

  RegisterPropertyEditor(TypeInfo(String),
                         TChartSeries,'ColorSource',TSeriesSourceProperty); // Do not localize

  RegisterPropertyEditor(TypeInfo(String),
                         TChartSeries,'XLabelsSource',TSeriesSourceProperty); // Do not localize

  RegisterPropertyEditor(TypeInfo(TChartPen), nil, '',TChartPenProperty);
  RegisterPropertyEditor(TypeInfo(TChartBrush), nil, '',TChartBrushProperty);

  RegisterPropertyEditor(TypeInfo(TView3DOptions),TCustomChart,
                         'View3DOptions', TView3DOptionsProperty); // Do not localize

  RegisterPropertyEditor(TypeInfo(TChartPage),nil,'',TChartPageProperty);

  RegisterPropertyEditor(TypeInfo(TChartCustomAxes),nil,'',TCustomAxesProperty);
end;
{$ENDIF}

end.
