home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / TEECHART / Src Code / CHARTREG.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-10-24  |  19.3 KB  |  657 lines

  1. {*****************************************}
  2. {   TeeChart 4.0 Standard version         }
  3. {                                         }
  4. { Component Registration Unit             }
  5. {                                         }
  6. { Comps:   TChart                         }
  7. {          TDBChart                       }
  8. {                                         }
  9. { Series:  TLineSeries                    }
  10. {          TAreaSeries                    }
  11. {          TPointSeries                   }
  12. {          TBarSeries                     }
  13. {          THorizBarSeries                }
  14. {          TPieSeries                     }
  15. {          TBubbleSeries                  }
  16. {          TGanttSeries                   }
  17. {          TChartShape                    }
  18. {          TArrowSeries                   }
  19. {          TFastLineSeries                }
  20. {                                         }
  21. {   Copyright (c) 1996-98 David Berneda   }
  22. {   All Rights Reserved                   }
  23. {*****************************************}
  24.  
  25. {$I teedefs.inc}
  26. unit ChartReg;
  27.  
  28. interface
  29.  
  30. Uses DsgnIntf,TeEngine,Chart,TeCanvas;
  31.  
  32. {$IFDEF D1}
  33. {$R TEECHART.D16}
  34. {$ELSE}
  35. {$R TEECHART.RES}
  36. {$ENDIF}
  37.  
  38. Type
  39.   TChartClassProperty=class(TClassProperty)
  40.   protected
  41.     procedure InternalEditPage(AChart:TCustomChart; APage:Integer);
  42.     procedure InternalEditSeries(ASeries:TChartSeries);
  43.   public
  44.     function GetAttributes : TPropertyAttributes; override;
  45.     function GetValue: string; override;
  46.   end;
  47.  
  48.   TChartCompEditor=class(TComponentEditor)
  49.   protected
  50.     procedure ChartExecuteVerb( Index : Integer; AChart:TCustomChart );
  51.   public
  52.     procedure Edit; override;
  53.     procedure ExecuteVerb( Index : Integer ); override;
  54.     function GetVerbCount : Integer; override;
  55.     function GetVerb( Index : Integer ) : string; override;
  56.   end;
  57.  
  58.   TDBChartCompEditor=class(TChartCompEditor)
  59.   public
  60.     procedure ExecuteVerb( Index : Integer ); override;
  61.     function GetVerbCount : Integer; override;
  62.     function GetVerb( Index : Integer ) : string; override;
  63.     procedure Edit; override;
  64.   end;
  65.  
  66.   TChartPenProperty=class(TChartClassProperty)
  67.   public
  68.     procedure Edit; override;
  69.   end;
  70.  
  71.   TChartBrushProperty=class(TChartClassProperty)
  72.   public
  73.     procedure Edit; override;
  74.   end;
  75.  
  76. procedure EditChartDesign(AChart:TCustomChart); { for QrTeeReg.pas }
  77.  
  78. procedure Register;
  79.  
  80. implementation
  81.  
  82. Uses TypInfo,Classes,EditChar,TeePrevi,TeeProcs,TeeConst,DBChart,DB,
  83.      WinTypes,WinProcs,SysUtils,Graphics,Clipbrd,TeeAbout,
  84. {$IFDEF D1}
  85.      IEdit16,
  86. {$ELSE}
  87.      IEditCha,IEdiSeri,IEdiGene,
  88. {$ENDIF}
  89.      DBEditCh,CustEdit,Series,PieEdit,AreaEdit,BarEdit,FLineEdi,
  90.      Forms,PenDlg,BrushDlg,Dialogs,BubbleCh,
  91.      ArrowCha,ArrowEdi,GanttCh,GanttEdi,
  92.      TeeShape,ShapeEdi,TeExport;
  93.  
  94. type
  95.   TChartLegendProperty=class(TChartClassProperty)
  96.   public
  97.     procedure Edit; override;
  98.   end;
  99.  
  100.   TCustomChartAxisProperty=class(TChartClassProperty)
  101.   public
  102.     procedure Edit; override;
  103.   end;
  104.  
  105.   TChartAxisTitleProperty=class(TClassProperty)
  106.   public
  107.     function GetValue: string; override;
  108.     function GetAttributes : TPropertyAttributes; override;
  109.   end;
  110.  
  111.   TChartSeriesListProperty=class(TClassProperty)
  112.   public
  113.     procedure Edit; override;
  114.     function GetValue: string; override;
  115.     function GetAttributes : TPropertyAttributes; override;
  116.   end;
  117.  
  118.   TSeriesPointerProperty=class(TChartClassProperty)
  119.   public
  120.     procedure Edit; override;
  121.   end;
  122.  
  123.   TChartTitleProperty=class(TChartClassProperty)
  124.   public
  125.     procedure Edit; override;
  126.   end;
  127.  
  128.   TChartWallProperty=class(TChartClassProperty)
  129.   public
  130.     procedure Edit; override;
  131.   end;
  132.  
  133.   TChartGradientProperty=class(TChartClassProperty)
  134.   public
  135.     procedure Edit; override;
  136.   end;
  137.  
  138.   TSeriesMarksProperty=class(TChartClassProperty)
  139.   public
  140.     procedure Edit; override;
  141.   end;
  142.  
  143.   TView3DOptionsProperty=class(TChartClassProperty)
  144.   public
  145.     procedure Edit; override;
  146.   end;
  147.  
  148. {$IFNDEF D1}
  149. type TFake=class
  150.     FAddCurrent   : Boolean;
  151.     FItems        : TStrings;
  152.     FFormDesigner :{$IFDEF D4}IFormDesigner{$ELSE}TFormDesigner{$ENDIF};
  153.     FProc         : TAddComponentDataSource;
  154.     Procedure AddDataSource(Const St:String);
  155.      end;
  156.  
  157. Procedure TFake.AddDataSource(Const St:String);
  158. Var tmpComp:TComponent;
  159. begin
  160.   if St<>'' then
  161.   begin
  162.     tmpComp:=FFormDesigner.GetComponent(St);
  163.     if tmpComp<>nil then
  164.        if Assigned(FProc) then FProc(tmpComp,FItems,FAddCurrent);
  165.   end;
  166. end;
  167.  
  168. Procedure DesignTimeOnGetDesignerNames( AProc      : TAddComponentDataSource;
  169.                     ASeries    : TChartSeries;
  170.                     AItems     : TStrings;
  171.                     AddCurrent : Boolean );
  172. Var tmpForm:{$IFDEF D3} TCustomForm {$ELSE} TForm {$ENDIF};
  173. begin
  174.   tmpForm:=GetParentForm(ASeries.ParentChart);
  175.   if (tmpForm<>nil) and (tmpForm.Designer<>nil) then
  176.   {$IFDEF D4}
  177.   With tmpForm.Designer as IFormDesigner do
  178.   {$ELSE}
  179.   With TFormDesigner(tmpForm.Designer) do
  180.   {$ENDIF}
  181.   begin
  182.     With TFake.Create do
  183.     try
  184.       FProc:=AProc;
  185.       FItems:=AItems;
  186.       FAddCurrent:=AddCurrent;
  187.       {$IFDEF D4}
  188.       FFormDesigner:=tmpForm.Designer as IFormDesigner;
  189.       {$ELSE}
  190.       FFormDesigner:=TFormDesigner(tmpForm.Designer);
  191.       {$ENDIF}
  192.       GetComponentNames(GetTypeData(TDataSource.ClassInfo),AddDataSource);
  193.       GetComponentNames(GetTypeData(TDataSet.ClassInfo),AddDataSource);
  194.       GetComponentNames(GetTypeData(TChartSeries.ClassInfo),AddDataSource);
  195.     finally
  196.       Free;
  197.     end;
  198.   end;
  199. end;
  200. {$ENDIF}
  201.  
  202. { Chart Editor }
  203. procedure EditChartDesign(AChart:TCustomChart);
  204. var Part:TChartClickedPart;
  205. begin
  206. {$IFNDEF D1}
  207.   InternalOnGetDesignerNames:=DesignTimeOnGetDesignerNames;
  208. {$ENDIF}
  209.   With AChart do CalcClickedPart(GetCursorPos,Part);
  210.   EditChartPart(nil,AChart,Part);
  211. end;
  212.  
  213. procedure TChartCompEditor.Edit;
  214. begin
  215.   EditChartDesign(TCustomChart(Component));
  216.   Designer.Modified;
  217. end;
  218.  
  219. procedure TChartCompEditor.ChartExecuteVerb( Index : Integer; AChart:TCustomChart );
  220. begin
  221.   Case Index of
  222.     3: TeeShowAboutBox({$IFDEF TEETRIAL}True{$ELSE}False{$ENDIF});
  223.     4: Edit;
  224.     5: ChartPreview(nil,AChart);
  225.     6: ChartExport(nil,AChart);
  226.   else
  227.     inherited ExecuteVerb(Index);
  228.   end;
  229. end;
  230.  
  231. procedure TChartCompEditor.ExecuteVerb( Index : Integer );
  232. begin
  233.   ChartExecuteVerb(Index,TCustomChart(Component));
  234. end;
  235.  
  236. function TChartCompEditor.GetVerbCount : Integer;
  237. begin
  238.   Result := 7;
  239. end;
  240.  
  241. function TChartCompEditor.GetVerb( Index : Integer ) : string;
  242. begin
  243.   result:='';
  244.   Case Index of
  245.     0: result:=TeeMsg_Version;
  246.     1: result:=TeeMsg_Copyright;
  247.     2: result:='-';  { <--- do not change or translate... }
  248.     3: result:=TeeMsg_About;
  249.     4: result:=TeeMsg_EditChart;
  250.     5: result:=TeeMsg_PrintPreview;
  251.     6: result:=TeeMsg_ExportChart;
  252.   end;
  253. end;
  254.  
  255. { Generic Chart Class Editor (for chart sub-components) }
  256. function TChartClassProperty.GetAttributes: TPropertyAttributes;
  257. begin
  258.   Result := [paSubProperties,paDialog];
  259. end;
  260.  
  261. function TChartClassProperty.GetValue: string;
  262. begin
  263.   FmtStr(Result, '(%s)', [GetPropType^.Name]);
  264. end;
  265.  
  266. procedure TChartClassProperty.InternalEditPage( AChart:TCustomChart;
  267.                         APage:Integer);
  268. begin
  269. {$IFNDEF D1}
  270.   InternalOnGetDesignerNames:=DesignTimeOnGetDesignerNames;
  271. {$ENDIF}
  272.   EditChartPage(nil,AChart,APage);
  273.   Designer.Modified;
  274. end;
  275.  
  276. procedure TChartClassProperty.InternalEditSeries(ASeries:TChartSeries);
  277. Begin
  278.   {$IFNDEF D1}
  279.   InternalOnGetDesignerNames:=DesignTimeOnGetDesignerNames;
  280.   {$ENDIF}
  281.   EditSeries(nil,ASeries);
  282.   Designer.Modified;
  283. end;
  284.  
  285. { Chart Legend Editor }
  286. procedure TChartLegendProperty.Edit;
  287. begin
  288. {$IFNDEF D1}
  289.   InternalOnGetDesignerNames:=DesignTimeOnGetDesignerNames;
  290. {$ENDIF}
  291.   EditChartLegend(nil,TCustomChart(TChartLegend(GetOrdValue).ParentChart));
  292.   Designer.Modified;
  293. end;
  294.  
  295. { Axis Chart Editor }
  296. procedure TCustomChartAxisProperty.Edit;
  297. begin
  298. {$IFNDEF D1}
  299.   InternalOnGetDesignerNames:=DesignTimeOnGetDesignerNames;
  300. {$ENDIF}
  301.   EditChartAxis(nil,TCustomChartAxis(GetOrdValue));
  302.   Designer.Modified;
  303. end;
  304.  
  305. { Chart Series Editor }
  306. function TChartSeriesListProperty.GetAttributes: TPropertyAttributes;
  307. begin
  308.   Result := [paDialog];
  309. end;
  310.  
  311. function TChartSeriesListProperty.GetValue: string;
  312. begin
  313.   FmtStr(Result, '(%s)', [GetPropType^.Name]);
  314. end;
  315.  
  316. procedure TChartSeriesListProperty.Edit;
  317. begin
  318. {$IFNDEF D1}
  319.   InternalOnGetDesignerNames:=DesignTimeOnGetDesignerNames;
  320. {$ENDIF}
  321.   EditChart(nil,TCustomChart(TChartSeriesList(GetOrdValue).Owner));
  322.   Designer.Modified;
  323. end;
  324.  
  325. { Chart Axis Title Editor }
  326. function TChartAxisTitleProperty.GetAttributes: TPropertyAttributes;
  327. begin
  328.   Result := [paSubProperties];
  329. end;
  330.  
  331. function TChartAxisTitleProperty.GetValue: string;
  332. begin
  333.   FmtStr(Result, '(%s)', [GetPropType^.Name]);
  334. end;
  335.  
  336. { Chart Title Editor }
  337. procedure TChartTitleProperty.Edit;
  338. begin
  339. {$IFNDEF D1}
  340.   InternalOnGetDesignerNames:=DesignTimeOnGetDesignerNames;
  341. {$ENDIF}
  342.   EditChartTitle(nil,TChartTitle(GetOrdValue));
  343.   Designer.Modified;
  344. end;
  345.  
  346. { Chart Wall Editor }
  347. procedure TChartWallProperty.Edit;
  348. begin
  349. {$IFNDEF D1}
  350.   InternalOnGetDesignerNames:=DesignTimeOnGetDesignerNames;
  351. {$ENDIF}
  352.   EditChartWall(nil,TChartWall(GetOrdValue));
  353.   Designer.Modified;
  354. end;
  355.  
  356. { Series Pointer Editor }
  357. procedure TSeriesPointerProperty.Edit;
  358. begin
  359.   InternalEditSeries(TSeriesPointer(GetOrdValue).ParentSeries);
  360. end;
  361.  
  362. { ChartPen Editor }
  363. procedure TChartPenProperty.Edit;
  364. begin
  365.   EditChartPen(nil,TChartPen(GetOrdValue));
  366.   Designer.Modified;
  367. end;
  368.  
  369. { ChartBrush Editor }
  370. procedure TChartBrushProperty.Edit;
  371. begin
  372.   EditChartBrush(nil,TBrush(GetOrdValue));
  373.   Designer.Modified;
  374. end;
  375.  
  376. { Chart Series Marks Editor }
  377. procedure TSeriesMarksProperty.Edit;
  378. var ASeries      : TChartSeries;
  379.     ASeriesMarks : TSeriesMarks;
  380. begin
  381.   ASeriesMarks:=TSeriesMarks(GetOrdValue);
  382.   if Assigned(ASeriesMarks) then
  383.   Begin
  384.     ASeries:=ASeriesMarks.ParentSeries;
  385.     if Assigned(ASeries) then InternalEditSeries(ASeries);
  386.   end;
  387. end;
  388.  
  389. { Axis Chart Editor }
  390. procedure TChartGradientProperty.Edit;
  391. begin
  392.   InternalEditPage(TCustomChart(TChartGradient(GetOrdValue).Owner),teeEditPanelPage);
  393. end;
  394.  
  395. { TSeriesDataSource Property }
  396. type
  397.   TSeriesDataSourceProperty = class(TComponentProperty)
  398.   private
  399.     {$IFNDEF D1}
  400.     FAddDataSetProc:TGetStrProc;
  401.     procedure AddDataSource(Const S:String);
  402.     {$ENDIF}
  403.   public
  404.     procedure GetValues(Proc: TGetStrProc); override;
  405.   end;
  406.  
  407. {$IFNDEF D1}
  408. procedure TSeriesDataSourceProperty.AddDataSource(Const S:String);
  409. Var tmpSeries:TChartSeries;
  410.     tmpComp:TComponent;
  411. begin
  412.   if S<>'' then
  413.   begin
  414.     tmpComp:=Designer.GetComponent(S);
  415.     if tmpComp<>nil then
  416.     begin
  417.       tmpSeries:=TChartSeries(GetComponent(0));
  418.       if tmpSeries.ParentChart.IsValidDataSource(tmpSeries,tmpComp) then
  419.      FAddDataSetProc(S);
  420.     end;
  421.   end;
  422. end;
  423. {$ENDIF}
  424.  
  425. procedure TSeriesDataSourceProperty.GetValues(Proc: TGetStrProc);
  426. Var tmpSeries:TChartSeries;
  427.  
  428.   {$IFDEF D1}
  429.   Procedure FillSourcesForm(AOwner:TComponent; Const AFormName:String);
  430.   var t:Longint;
  431.       AComponent:TComponent;
  432.   begin
  433.     if Assigned(AOwner) then
  434.     for t:=0 to AOwner.ComponentCount-1 do
  435.     begin
  436.       AComponent:=AOwner.Components[t];
  437.       if (AComponent.Name<>'') and
  438.      tmpSeries.ParentChart.IsValidDataSource(tmpSeries,AComponent) then
  439.      if AFormName='' then Proc(AComponent.Name)
  440.              else Proc(AFormName+'.'+AComponent.Name);
  441.     end;
  442.   end;
  443.   {$ENDIF}
  444.  
  445. begin
  446.   tmpSeries:=TChartSeries(GetComponent(0));
  447.   if tmpSeries.ParentChart<>nil then
  448.   Begin
  449.     {$IFNDEF D1}
  450.     FAddDataSetProc:=Proc;
  451.     Designer.GetComponentNames(GetTypeData(TDataSource.ClassInfo),AddDataSource);
  452.     Designer.GetComponentNames(GetTypeData(TDataSet.ClassInfo),AddDataSource);
  453.     Designer.GetComponentNames(GetTypeData(TChartSeries.ClassInfo),AddDataSource);
  454.     {$ELSE}
  455.     FillSourcesForm(Designer.Form,'');
  456.     {$ENDIF}
  457.   end;
  458. end;
  459.  
  460. { TValueSource Property }
  461. type
  462.   TValueSourceProperty=class(TStringProperty)
  463.   public
  464.     function GetAttributes : TPropertyAttributes; override;
  465.     procedure GetValues(Proc: TGetStrProc); override;
  466.   end;
  467.  
  468. function TValueSourceProperty.GetAttributes : TPropertyAttributes;
  469. Begin
  470.   result:=inherited GetAttributes+[paValueList];
  471. end;
  472.  
  473. procedure TValueSourceProperty.GetValues(Proc: TGetStrProc);
  474. Var AValueList:TChartValueList;
  475. begin
  476.   AValueList:=TChartValueList(GetComponent(0));
  477.   With AValueList.Owner do
  478.   if (ParentChart<>nil) then
  479.       TCustomChart(ParentChart).FillValueSourceItems(AValueList,Proc);
  480. end;
  481.  
  482. { TSeriesSource Property }
  483. type
  484.   TSeriesSourceProperty=class(TStringProperty)
  485.   public
  486.     function GetAttributes : TPropertyAttributes; override;
  487.     procedure GetValues(Proc: TGetStrProc); override;
  488.   end;
  489.  
  490. procedure TSeriesSourceProperty.GetValues(Proc: TGetStrProc);
  491. Var ASeries:TChartSeries;
  492. begin
  493.   ASeries:=TChartSeries(GetComponent(0));
  494.   With ASeries do
  495.   if (ParentChart<>nil) then
  496.      TCustomChart(ParentChart).FillSeriesSourceItems(ASeries,Proc);
  497. end;
  498.  
  499. function TSeriesSourceProperty.GetAttributes : TPropertyAttributes;
  500. Begin
  501.   result:=inherited GetAttributes+[paValueList];
  502. end;
  503.  
  504. { DBChart Editor }
  505. procedure TDBChartCompEditor.ExecuteVerb( Index : Integer );
  506. begin
  507.   if Index+1=GetVerbCount then
  508.      TCustomDBChart(Component).RefreshData
  509.   else
  510.      inherited ExecuteVerb(Index);
  511. end;
  512.  
  513. function TDBChartCompEditor.GetVerbCount : Integer;
  514. begin
  515.   Result := inherited GetVerbCount+1;
  516. end;
  517.  
  518. function TDBChartCompEditor.GetVerb( Index : Integer ) : string;
  519. begin
  520.   if Index+1=GetVerbCount then
  521.      result:=TeeMsg_RefreshData
  522.   else
  523.      result:=inherited GetVerb(Index);
  524. end;
  525.  
  526. procedure TDBChartCompEditor.Edit;
  527. begin
  528.   EditChartDesign(TCustomDBChart(Component));
  529.   Designer.Modified;
  530. end;
  531.  
  532. { View3DOptions Editor }
  533. procedure TView3DOptionsProperty.Edit;
  534. begin
  535.   InternalEditPage(TCustomChart(TView3DOptions(GetOrdValue).Parent),teeEdit3DPage);
  536. end;
  537.  
  538. procedure Register;
  539. begin
  540.   RegisterNoIcon( [ TChartSeries, TTeeFunction ]);
  541.  
  542.   RegisterComponents( tcAdditional, [TChart] );
  543.   RegisterComponentEditor(TCustomChart,TChartCompEditor);
  544.  
  545.   RegisterComponents( tcDControls, [TDBChart] );
  546.   RegisterComponentEditor(TCustomDBChart,TDBChartCompEditor);
  547.  
  548.   {$IFDEF TEENOREGAX}
  549.   RegisterNonActiveX( [ TCustomTeePanel,
  550.             TCustomAxisPanel,
  551.             TCustomChart,TChart,
  552.             TCustomDBChart,TDBChart] , axrIncludeDescendants );
  553.   {$ENDIF}
  554.  
  555.   RegisterPropertyEditor(TypeInfo(TSeriesMarks),TChartSeries,
  556.                   'Marks', TSeriesMarksProperty);
  557.   RegisterPropertyEditor(TypeInfo(TSeriesPointer), TCustomSeries, 'Pointer',
  558.                            TSeriesPointerProperty);
  559.  
  560.   {$IFDEF D3}
  561.   RegisterPropertyEditor(TypeInfo(TChartWall),nil,
  562.                   '', TChartWallProperty);
  563.   {$ELSE}
  564.   RegisterPropertyEditor(TypeInfo(TChartWall),TCustomChart,
  565.                   'LeftWall', TChartWallProperty);
  566.   RegisterPropertyEditor(TypeInfo(TChartWall),TCustomChart,
  567.                   'BottomWall', TChartWallProperty);
  568.   RegisterPropertyEditor(TypeInfo(TChartWall),TCustomChart,
  569.                   'BackWall', TChartWallProperty);
  570.   {$ENDIF}
  571.  
  572.   {$IFDEF D3}
  573.   RegisterPropertyEditor(TypeInfo(TChartTitle),TCustomChart,
  574.                   '', TChartTitleProperty);
  575.   {$ELSE}
  576.   RegisterPropertyEditor(TypeInfo(TChartTitle),TCustomChart,
  577.                   'Title', TChartTitleProperty);
  578.   RegisterPropertyEditor(TypeInfo(TChartTitle),TCustomChart,
  579.                   'Foot', TChartTitleProperty);
  580.   {$ENDIF}
  581.  
  582.   RegisterPropertyEditor(TypeInfo(TCustomChartLegend),TCustomChart,
  583.                   'Legend', TChartLegendProperty);
  584.  
  585.   {$IFDEF D3}
  586.   RegisterPropertyEditor(TypeInfo(TCustomChartAxis),TCustomChart,
  587.                   '', TCustomChartAxisProperty);
  588.   {$ELSE}
  589.   RegisterPropertyEditor(TypeInfo(TCustomChartAxis),TCustomChart,
  590.                   'LeftAxis', TCustomChartAxisProperty);
  591.   RegisterPropertyEditor(TypeInfo(TCustomChartAxis),TCustomChart,
  592.                   'RightAxis', TCustomChartAxisProperty);
  593.   RegisterPropertyEditor(TypeInfo(TCustomChartAxis),TCustomChart,
  594.                   'TopAxis', TCustomChartAxisProperty);
  595.   RegisterPropertyEditor(TypeInfo(TCustomChartAxis),TCustomChart,
  596.                   'BottomAxis', TCustomChartAxisProperty);
  597.   RegisterPropertyEditor(TypeInfo(TCustomChartAxis),TCustomChart,
  598.                   'DepthAxis', TCustomChartAxisProperty);
  599.   {$ENDIF}
  600.  
  601.   RegisterPropertyEditor(TypeInfo(TChartSeriesList), TCustomChart, 'SeriesList',
  602.                              TChartSeriesListProperty);
  603.   RegisterPropertyEditor(TypeInfo(TChartAxisTitle), TCustomChartAxis, 'Title',
  604.                             TChartAxisTitleProperty);
  605.   RegisterPropertyEditor(TypeInfo(TChartGradient),TCustomChart,
  606.                   'Gradient', TChartGradientProperty);
  607.  
  608.   RegisterPropertyEditor( TypeInfo(TComponent),
  609.               TChartSeries,'DataSource',TSeriesDataSourceProperty);
  610.  
  611.   RegisterPropertyEditor( TypeInfo(String),
  612.               TChartValueList,'ValueSource',TValueSourceProperty);
  613.  
  614.   RegisterPropertyEditor( TypeInfo(String),
  615.               TChartSeries,'ColorSource',TSeriesSourceProperty);
  616.   RegisterPropertyEditor( TypeInfo(String),
  617.               TChartSeries,'XLabelsSource',TSeriesSourceProperty);
  618.  
  619.   {$IFDEF D3}
  620.   RegisterPropertyEditor(TypeInfo(TChartPen), nil, '',TChartPenProperty);
  621.   {$ELSE}
  622.   RegisterPropertyEditor(TypeInfo(TChartPen), TChartLegend, 'Frame',TChartPenProperty);
  623.   RegisterPropertyEditor(TypeInfo(TChartPen), TChartTitle,  'Frame',TChartPenProperty);
  624.   RegisterPropertyEditor(TypeInfo(TChartPen), TCustomChartAxis,   'Ticks',TChartPenProperty);
  625.   RegisterPropertyEditor(TypeInfo(TChartPen), TCustomChartAxis,   'MinorTicks',TChartPenProperty);
  626.   RegisterPropertyEditor(TypeInfo(TChartPen), TCustomChartAxis,   'TicksInner',TChartPenProperty);
  627.   RegisterPropertyEditor(TypeInfo(TChartPen), TCustomChartAxis,   'Axis',TChartPenProperty);
  628.   RegisterPropertyEditor(TypeInfo(TChartPen), TCustomChartAxis,   'Grid',TChartPenProperty);
  629.   RegisterPropertyEditor(TypeInfo(TChartPen), TCustomChart, 'Frame',TChartPenProperty);
  630.   RegisterPropertyEditor(TypeInfo(TChartPen), TSeriesMarks, 'Frame',TChartPenProperty);
  631.   RegisterPropertyEditor(TypeInfo(TChartPen), TSeriesMarks, 'Arrow',TChartPenProperty);
  632.   RegisterPropertyEditor(TypeInfo(TChartPen), TCustomSeries,'LinePen',TChartPenProperty);
  633.   RegisterPropertyEditor(TypeInfo(TChartPen), TCustomSeries,'AreaLinesPen',TChartPenProperty);
  634.   RegisterPropertyEditor(TypeInfo(TChartPen), TSeriesPointer, 'Pen',TChartPenProperty);
  635.   RegisterPropertyEditor(TypeInfo(TChartPen), TBarSeries,   'BarPen',TChartPenProperty);
  636.   RegisterPropertyEditor(TypeInfo(TChartPen), TCircledSeries,'PiePen',TChartPenProperty);
  637.   RegisterPropertyEditor(TypeInfo(TChartPen), TGanttSeries, 'ConnectingPen',TChartPenProperty);
  638.   RegisterPropertyEditor(TypeInfo(TChartPen), TChartWall,   'Pen',TChartPenProperty);
  639.   RegisterPropertyEditor(TypeInfo(TChartPen), TFastLineSeries, 'LinePen',TChartPenProperty);
  640.   RegisterPropertyEditor(TypeInfo(TChartPen), TChartShape, 'Pen',TChartPenProperty);
  641.   {$ENDIF}
  642.  
  643.   {$IFDEF D3}
  644.   RegisterPropertyEditor(TypeInfo(TChartBrush), nil, '',TChartBrushProperty);
  645.   {$ELSE}
  646.   RegisterPropertyEditor(TypeInfo(TChartBrush), TChartShape, 'Brush',TChartBrushProperty);
  647.   RegisterPropertyEditor(TypeInfo(TChartBrush), TCustomBarSeries, 'BarBrush',TChartBrushProperty);
  648.   RegisterPropertyEditor(TypeInfo(TChartBrush), TChartTitle, 'Brush',TChartBrushProperty);
  649.   RegisterPropertyEditor(TypeInfo(TChartBrush), TChartWall, 'Brush',TChartBrushProperty);
  650.   {$ENDIF}
  651.  
  652.   RegisterPropertyEditor(TypeInfo(TView3DOptions),TCustomChart,
  653.                   'View3DOptions', TView3DOptionsProperty);
  654. end;
  655.  
  656. end.
  657.