{*********************************************}
{ TeeChart Pro                                }
{ Copyright (c) 1996-2020 by Steema Software  }
{                                             }
{ Component Registration Unit                 }
{                                             }
{ Functions:                                  }
{          TCountTeeFunction                  }
{          TCurveFittingTeeFunction           }
{          TAverageTeeFunction                }
{          TMovingAverageTeeFunction          }
{          TExpMovAveFunction                 }
{          TExpAverageTeeFunction             }
{          TSmoothedMovAvgunction             }
{          TMomentumTeeFunction               }
{          TRSITeeFunction                    }
{          TStdDeviationTeeFunction           }
{          TMACDFunction                      }
{          TMoneyFlowFunction                 }
{          TRootMeanSquareFunction            }
{          TCumulative                        }
{          TCompressFunction                  }
{          TCrossPointsFunction               }
{          TSmoothPointsFunction              }
{          TCLVFunction                       }
{          TOBVFunction                       }
{          TPVOFunction                       }
{          TSARFunction                       }
{          TSkewnessFunction                  }
{          TKurtosisFunction                  }
{          TATRFunction                       }
{          TRVIFunction                       }
{          TAOFunction                        }
{          TACFunction                        }
{          TAlligatorFunction                 }
{          TGatorFunction                     }
{          TPercentChangeFunction             }
{          TSlopeFunction                     }
{          TDownSamplingFunction              } 
{                                             }
{ Series:                                     }
{          TCandleSeries                      }
{          TVolumeSeries                      }
{          TSurfaceSeries                     }
{          TContourSeries                     }
{          TWaterFallSeries                   }
{          TErrorBarSeries                    }
{          TPolarSeries                       }
{          TBezierSeries                      }
{          TPoint3DSeries                     }
{          TDonutSeries                       }
{          TBoxPlotSeries                     }
{          THistogramSeries                   }
{          TSmithSeries                       }
{          TPyramidSeries                     }
{          TMapSeries                         }
{          TPointFigureSeries                 }
{          TGaugeSeries                       }
{          TTowerSeries                       }
{          TVector3DSeries                    }
{          TVolumePipeSeries                  }
{          THighLowLineSeries                 }
{          TWorldSeries (GIS / Mapping)       }
{          TOrgSeries (Organization Charts)   }
{          TTagCloudSeries (Cloud of tags)    }
{          TNumericGauge (LED / LCD gauge)    }
{          TLinearGauge                       }
{          TCircularGauge                     }
{          TTernarySeries                     }
{          TKnobGauge                         }
{          TTreeMapSeries (Treemaps)          }
{          TeeEquiVolume    				  }
{          TActivityGauge					  }
{          TEqualizerSeries 				  }
{                                             }
{ Tools:                                      }
{          TCursorTool                        }
{          TDragMarksTool                     }
{          TDrawLineTool                      }
{          THintsTool                         }
{          TRotateTool                        }
{          TAxisArrowTool                     }
{          TColorLineTool                     }
{          TColorBandTool                     }
{          TImageTool                         }
{          TPageNumTool                       }
{          TDragPointTool                     }
{          TExtraLegendTool                   }
{          TSeriesAnimationTool               }
{          TGanttTool                         }
{          TGridBandTool                      }
{          TPieTool                           }
{          TLightTool                         }
{          TLegendScrollBar                   }
{          TSurfaceNearestTool                }
{          TSelectorTool                      }
{          TClipSeriesTool                    }
{          TSeriesBandTool                    }
{          TDataTableTool                     }
{          TSeriesStatsTool                   }
{          TVideoTool                         }
{          TVideoPlayerTool                   }
{          TAntiAliasTool                     }
{          TBannerTool                        }
{          TMagnifyTool                       }
{          TLegendPaletteTool                 }
{          TText3DTool                        }
{          TSubChartTool                      }
{          TLinkTool                          }
{          TFibonacciTool                     }
{          TScrollPagerTool                   }
{          TClusteringTool                    }
{                                             }
{ Other:                                      }
{          TTeeCommander                      }
{          TChartEditor                       }
{          TChartPreviewer                    }
{          TChartScrollBar                    }
{          TChartListBox                      }
{          TSeriesDataSet*                    }
{          TChartGalleryPanel                 }
{          TChartGrid                         }
{          TChartGridNavigator                }
{          TChartPageNavigator                }
{          TChartWebSource                    }
{          TSeriesTextSource                  }
{          TTeeInspector                      }
{          TTeeXMLSource                      }
{          TTeeExcelSource                    }
{          TImageFiltered                     }
{          TChartBook                         }
{          TImportChart                       }
{          TDashBoard                         }
{          TDataImport                        } 
{          TChartLayout                       }
{                                             }
{          Alternate Gallery                  }
{                                             }
{ Sample Series:                              }
{          TMyPointSeries                     }
{          TBar3DSeries                       }
{          TBigCandleSeries                   }
{          TImagePointSeries                  }
{          TDeltaPoint                        }
{          TImageBarSeries                    }
{          TWindRoseSeries                    }
{          TClockSeries                       }
{          TBarJoinSeries                     }
{          TCalendarSeries                    }
{                                             }
{ TeeChart Actions (for Delphi 4 and up)      }
{          *Many*                             }
{                                             }
{ * TSeriesDataSet not available in           }
{   STANDARD versions of Delphi/CBuilder      }
{                                             }
{*********************************************}
unit TeeChartPro;
{$I TeeDefs.inc}

interface

procedure Register;

implementation

{$IFDEF BCB}
{$IFNDEF D14}
{$DEFINE TEENOSERIESDESIGN}
{$ENDIF}
{$ENDIF}

{$IFDEF LCL}
{$DEFINE TEENOSERIESDESIGN}
{$ENDIF}

Uses Classes, SysUtils,

      {$IFDEF D6}
       {$IFDEF LCL}
       PropEdits, ComponentEditors,
       {$ELSE}
       DesignIntf,
       DesignEditors,
       {$ENDIF}
      {$ELSE}
       {$IFDEF LCL}
       PropEdits, ComponentEditors,
       {$ELSE}
       DsgnIntf,
       {$ENDIF}
      {$ENDIF}

     Controls, Graphics, Dialogs, ActnList, Forms,

     {$IFDEF D15}
     ToolsAPI,
     {$ENDIF}

     {$IFDEF D17}
     System.Actions,
     {$ENDIF}

     {$IFNDEF TEENOSERIESDESIGN}
     TeeSeriesDesign,
     {$ENDIF}

     TeeTranslate, TeeLanguages,

     TeePenDlg,
     CandleCh, CurvFitt, ErrorBar, TeeErrBarEd, TeeSurfa, TeeNavigator,
     TeeSurfEdit, TeePolar, TeePolarEditor, TeeCandlEdi, StatChar,
     TeEngine, Chart, TeeProcs, TeeChartReg, TeeEditPro, TeeConst, TeeProCo,
     TeeBezie, TeePoin3, TeCanvas, TeeScroB, TeeEdit, TeeComma, TeeVolEd,
     TeeLisB, TeeEdiGene, TeeInspector, TeeCount, TeeCumu, TeeDonut,
     TeeTools, TeeTriSurface, TeeDragPoint, TeeGalleryPanel, TeePrevi,
     MyPoint, Bar3D, BigCandl,
     ImaPoint, ImageBar, TeeImaEd, TeeRose, TeeChartGrid, TeeBoxPlot,
     TeeURL, TeeSeriesTextEd, TeeMapSeries, TeeChartActions,
     TeeSmith, TeeTernary, TeeCalendar, TeeCompressOHLC, TeeExtraLegendTool,
     TeeCLVFunction, TeeOBVFunction, TeeDownSampling, TeeSeriesAnimEdit,
     TeePointFigure, TeeGanttTool, TeeAnimations, TeeAnimate,

     {$IFNDEF LINUX}
     {$IFNDEF LCL}
     TeeXML,
     {$ENDIF}
     {$ENDIF}

     {$IFDEF D9}
     TeeJpeg, TeePNG, TeeGIF, TeeSVGCanvas, TeePSCanvas, TeeVMLCanvas,
     TeePDFCanvas, TeeXAMLCanvas, TeeFlexCanvas, TeeVRML3D, TeeHTML5Canvas,
     TeeJavaScript,

     TeeJavascriptEditor, TeeXAMLCanvasEditor, TeeSVGCanvasEditor,
     TeePDFOptions,

     {$ENDIF}

     TeeGridBandToolEdit, TeeGaugeEditor, TeeTowerEdit, TeePieTool,
     TeeLighting, TeeDataTableTool, TeeDataTableEditor, TeeVolumePipe,
     TeeDownSamplingEditor,

     {$IFNDEF TEENOTHEMES}
     TeeThemes, TeeThemeEditor,
     {$ENDIF}

     TeeDesignOptions,
     TeeLegendScrollBar, TeeSurfaceTool, TeeSelectorTool, TeeEditCha,
     TeeCustomLegendTool,

     {$IFNDEF LCL}
     TeeExcelSource,
     {$ENDIF}

     {$IFNDEF LCL}
     TeeVideo,
     TeeVideoPlayer,
     {$ENDIF}

     TeeSeriesStats, TeeHighLowLine, TeeSeriesRegion, TeeSAR,
     TeeChartBook, TeeDashBoard, TeeSubChart, EditChar,
     TeeMagnifyTool, TeeOrgSeriesEditor,

     {$IFNDEF NOUSE_BDE}
     TeeWorldSeriesEditor,
     {$ENDIF}

     TeeTagCloudEditor,
     TeeNumericGaugeEditor, TeeLinearGaugeEditor,
     TeeTreeMapSeriesEditor,
     TeeLinkTool, TeeFibonacciEditor, TeeCircularGaugeEditor,
     TeeKnobGaugeEditor,
     TeeToolsGalleryDemos, TeeAnimationsGalleryDemos,  // <-- tools+animations demos only at design-time package
     TeeEquiVolume, TeeEquiVolEdi, TeeScrollPagerTool, TeeClusteringTool,
     TeeEditAnimations,
     TeeBubbleCloudEdit,
     TeeImport,
     TeeImportEditor,
     TeeChartLayout,
     TeeActivityGaugeEdit,
	 TeeEqualizerEdit;


{$IFDEF TEEEDITORS}
type
  TChartEditorCompEditor=class(TComponentEditor)
  public
    procedure ExecuteVerb( Index : Integer ); override;
    function GetVerbCount : Integer; override;
    function GetVerb( Index : Integer ) : string; override;
  end;

{ TChartEditorCompEditor }
procedure TChartEditorCompEditor.ExecuteVerb( Index : Integer );
begin
  if Index=0 then TCustomChartEditor(Component).Execute
             else inherited;
end;

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

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

type
  TTeeCustomToolAxisProperty = class(TPropertyEditor)
  public
    function GetAttributes : TPropertyAttributes; override;
    procedure GetValues(Proc: TGetStrProc); override;
    function GetValue: string; override;
    procedure SetValue(const Value: string); override;
  end;

{ TTeeCustomToolAxisProperty }
function TTeeCustomToolAxisProperty.GetAttributes: TPropertyAttributes;
begin
  result:=[paValueList,paMultiSelect,paRevertable]
end;

function TTeeCustomToolAxisProperty.GetValue: string;
begin
  With TTeeCustomToolAxis(GetComponent(0)) do
       result:=TCustomChart(ParentChart).AxisTitleOrName(Axis);
end;

procedure TTeeCustomToolAxisProperty.GetValues(Proc: TGetStrProc);
begin
  inherited;

  Proc(TeeMsg_LeftAxis);
  Proc(TeeMsg_RightAxis);
  Proc(TeeMsg_TopAxis);
  Proc(TeeMsg_BottomAxis);
end;

procedure TTeeCustomToolAxisProperty.SetValue(const Value: string);

  procedure SetAxis(const Axis:TChartAxis);
  begin
    {$IFDEF WIN64}
    SetInt64Value(NativeInt(Axis));
    {$ELSE}
    SetOrdValue(Integer(Axis));
    {$ENDIF}
  end;

var tmp : TCustomAxisPanel;
begin
  tmp:=TTeeCustomToolAxis(GetComponent(0)).ParentChart;

  if Value=TeeMsg_LeftAxis then SetAxis(tmp.LeftAxis)
  else
  if Value=TeeMsg_RightAxis then SetAxis(tmp.RightAxis)
  else
  if Value=TeeMsg_TopAxis then SetAxis(tmp.TopAxis)
  else
  if Value=TeeMsg_BottomAxis then SetAxis(tmp.BottomAxis)
end;

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

{ TChartWebCompEditor }
procedure TChartWebCompEditor.ExecuteVerb(Index:Integer);
begin
  if Index=0 then
  begin
    Screen.Cursor:=crHourGlass;
    try
      TChartWebSource(Component).Execute;
    finally
      Screen.Cursor:=crDefault;
    end;
  end
  else inherited;
end;

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

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

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

{ TImportChartEditor }
procedure TImportChartEditor.ExecuteVerb(Index:Integer);
var tmpDialog : TOpenDialog;
begin
  if Index=0 then
  begin
    tmpDialog:=TOpenDialog.Create(nil);
    try
      tmpDialog.Filter:=TeeMsg_TeeFiles+' (*.'+TeeMsg_TeeExtension+')'; // Do not localize

      tmpDialog.Filter:=tmpDialog.Filter+'|*.'+TeeMsg_TeeExtension; // Do not localize
      tmpDialog.Options:=[ofHideReadOnly, ofFileMustExist];

      if tmpDialog.Execute then
      begin
        Screen.Cursor:=crHourGlass;
        try
          TImportChart(Component).LoadFromFile(tmpDialog.FileName);
        finally
          Screen.Cursor:=crDefault;
        end;
      end;
    finally
      tmpDialog.Free;
    end;
  end
  else inherited;
end;

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

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

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

{ TSeriesTextCompEditor }
procedure TSeriesTextCompEditor.ExecuteVerb(Index:Integer);
begin
  if Index=0 then
  begin
    if TeeEditSeriesTextSource(TSeriesTextSource(Component)) then
       Designer.Modified;
  end
  else inherited;
end;

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

function TSeriesTextCompEditor.GetVerb(Index:Integer):string;
begin
  if Index=0 then result:=TeeMsg_Edit
             else result:=inherited GetVerb(Index);
end;
{$ENDIF}

type
  TInnerChartProperty=class(TChartClassProperty)
  public
    procedure Edit; override;
  end;

{ TInnerChart editor (used by TSubChartTool) }
procedure TInnerChartProperty.Edit;
begin
  EditChart(nil,TCustomChart(GetObject));
  Designer.Modified;
end;

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

procedure TTeeToolEditor.Edit;
begin
  if Assigned(TeeEditToolProc) then
     TeeEditToolProc(nil,TTeeCustomTool(Component));
end;

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

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

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


type
  TTeeAnimateCompEditor=class(TComponentEditor)
  public
    procedure Edit; override;
  end;

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

procedure TTeeAnimateCompEditor.Edit;
begin
  TFormTeeAnimations.Edit(nil,TTeeAnimate(Component));
  Designer.Modified;
end;

{ TeeAnimate.Animations Editor }
procedure TAnimationsProperty.Edit;
var Animate : TTeeAnimate;
begin
  Animate:=TAnimations(GetObject).Animate as TTeeAnimate;
  TFormTeeAnimations.Edit(nil,Animate);
  Designer.Modified;
end;

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

{$IFDEF D15}
type
  TTeeAddinOptions=class(TInterfacedObject,INTAAddinOptions)
  private
    FOptions : TOptionsForm;
  public
    procedure DialogClosed(Accepted: Boolean);
    procedure FrameCreated(AFrame: TCustomFrame);
    function GetArea: string;
    function GetCaption: string;
    function GetFrameClass: TCustomFrameClass;
    function ValidateContents: Boolean;
    function GetHelpContext: Integer;
    function IncludeInIDEInsight: Boolean;
  end;

procedure TTeeAddinOptions.DialogClosed(Accepted: Boolean);
begin
  if Accepted then
  begin
    FOptions.Save;
    TeeSetLanguage(True);
  end;
end;

procedure TTeeAddinOptions.FrameCreated(AFrame: TCustomFrame);
begin
  FOptions:=TOptionsForm.Create(AFrame.Owner);
  FOptions.ScaledChart:=False;
  FOptions.Panel1.Visible:=False;
  FOptions.Align:=alClient;

  AddFormTo(FOptions,AFrame);
end;

function TTeeAddinOptions.GetArea: string;
begin
  result:='';
end;

function TTeeAddinOptions.GetCaption: string;
begin
  result:=TeeMsg_TeeChartPalette;
end;

function TTeeAddinOptions.GetFrameClass: TCustomFrameClass;
begin
  result:=TFrame;
end;

function TTeeAddinOptions.GetHelpContext: Integer;
begin
  result:=-1;
end;

function TTeeAddinOptions.IncludeInIDEInsight: Boolean;
begin
  result:=True;
end;

function TTeeAddinOptions.ValidateContents: Boolean;
begin
  result:=True;
end;

var
  TeeAddinOptions:TTeeAddinOptions=nil;
{$ENDIF}

procedure Register;
begin
  {$IFDEF D9}
  // D2006 Report shows only reason for not demand-loading are the registered Actions,
  // so it is safe to force demand-load as Actions only need classes in this package.
//  ForceDemandLoadState(dlEnable);
  {$ENDIF}

  {$IFDEF D6}
  TeeActivateGroup;

  GroupDescendentsWith(TCustomChartEditor,TControl);
  GroupDescendentsWith(TCustomChartLink,TControl);
  {$ENDIF}

  { Pro Components }
  RegisterComponents(TeeMsg_TeeChartPalette, [ TChartEditor,
                                               TChartPreviewer,
                                               TChartScrollBar,
                                               TTeeCommander,
                                               TChartListBox,
                                               TChartEditorPanel,
                                               TChartGalleryPanel,
                                               TChartGrid,
                                               TChartGridNavigator,
                                               TChartPageNavigator,
                                               TChartWebSource,
                                               TTeeInspector,

                                               {$IFNDEF LINUX}
                                               {$IFNDEF LCL}
                                               TTeeXMLSource,
                                               {$ENDIF}
                                               {$ENDIF}

                                               {$IFNDEF LCL}
                                               TTeeExcelSource,
                                               {$ENDIF}

                                               TSeriesTextSource,
                                               TChartBook,
                                               TDashBoard,
                                               TImportChart,
                                               TTeeAnimate,
                                               TDataImport,
                                               TChartLayout 
                                             ]);


  { Pro Editors }

  {$IFDEF TEEEDITORS}
  RegisterComponentEditor(  TChartEditor,TChartEditorCompEditor);
  RegisterComponentEditor(  TChartPreviewer,TChartEditorCompEditor);
  RegisterComponentEditor(  TChartWebSource,TChartWebCompEditor);
  RegisterComponentEditor(  TSeriesTextSource,TSeriesTextCompEditor);

  RegisterPropertyEditor(TypeInfo(TChartAxis), TTeeCustomToolAxis, '',TTeeCustomToolAxisProperty);
  RegisterPropertyEditor(TypeInfo(TCustomChart),TSubChart,'Chart',TInnerChartProperty); // Do not localize
  RegisterPropertyEditor(TypeInfo(TCustomChart),TChartItem,'Chart',TInnerChartProperty); // Do not localize

  RegisterComponentEditor(  TImportChart,TImportChartEditor);
  RegisterComponentEditor(  TTeeCustomTool,TTeeToolEditor);

  RegisterComponentEditor(  TTeeAnimate,TTeeAnimateCompEditor);
  RegisterPropertyEditor(TypeInfo(TAnimations), TTeeAnimate, 'Animations', // Do not localize
                         TAnimationsProperty);

  {$ENDIF}

  { Chart Actions }

  {$IFNDEF TEENOACTIONS}
  RegisterActions(TeeMsg_CategoryChartActions,
                  [ TChartAction3D,TChartActionEdit,
                    TChartActionCopy,TChartActionPrint,
                    TChartActionAxes,TChartActionGrid,
                    TChartActionLegend,
                    TChartActionSave ],nil);

  { Series Actions }
  RegisterActions(TeeMsg_CategorySeriesActions,
                  [ TSeriesActionActive,TSeriesActionEdit,
                    TSeriesActionMarks ], nil);
  {$ENDIF}

  TeeSetLanguage(False);

  {$IFDEF D15}
  // Environment->Options->Third Party->TeeChart
  if not Assigned(TeeAddinOptions) then
  begin
    TeeAddinOptions:=TTeeAddinOptions.Create;
    (BorlandIDEServices as INTAEnvironmentOptionsServices).RegisterAddInOptions(TeeAddinOptions);
  end;
  {$ENDIF}
end;

Function TeeNewChartProc(const Chart:TCustomChart):TChartThemeClass;
begin
  {$IFNDEF TEENOTHEMES}
  if (TeeNewChartTheme>0) and (ChartThemes.Count>TeeNewChartTheme) then
  begin
    result:=TChartThemeClass(ChartThemes[TeeNewChartTheme]);
    ApplyChartTheme(result,Chart,TeeNewChartPalette);
  end
  else
  {$ENDIF}
  begin
    if TeeNewChartPalette<>-1 then
       Chart.ColorPaletteIndex:=TeeNewChartPalette;

    result:=nil;
  end;
end;

{$IFNDEF TEELITE}
Procedure TeeOptionsFormHook;
begin
  with TOptionsForm.Create(nil) do
  try
    if ShowModal=mrOk then
       TeeSetLanguage(True);
  finally
    Free;
  end;
end;
{$ENDIF}

initialization
  {$IFNDEF TEENOSERIESDESIGN}
  TeeChartEditorHook:=TeeShowSeriesEditor;
  {$ENDIF}

  TeeNewChartTheme:=TeeReadIntegerOption(TeeMsg_DefaultTheme,TeeNewChartDefaultTheme);
  TeeNewChartPalette:=TeeReadIntegerOption(TeeMsg_DefaultPalette,TeeNewChartDefaultPalette);

  TeeNewChartHook:=TeeNewChartProc;

  {$IFNDEF TEELITE}
  TeeDesignOptionsHook:=TeeOptionsFormHook;
  {$ENDIF}

finalization

  {$IFDEF D15}
  // Environment->Options->Third Party->TeeChart
  if Assigned(TeeAddinOptions) then
  begin
    (BorlandIDEServices as INTAEnvironmentOptionsServices).UnregisterAddInOptions(TeeAddinOptions);
    TeeAddinOptions:=nil;
  end;
  {$ENDIF}

  // un-hook
  TeeNewChartHook:=nil;
  TeeChartEditorHook:=nil;    // For TeeChartReg "Series..." menu item

  {$IFNDEF TEELITE}
  TeeDesignOptionsHook:=nil;  // For TeeChartReg "Options..." menu item
  {$ENDIF}

  if TeeLanguage<>TeeEnglishLanguage then // Reset language
     TeeSetEnglish;
end.
