home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / Delphi / TeeChartPro / TeeChart5Delphi5Eval.exe / %MAINDIR% / Examples / Features / Tools_Custom.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-09-10  |  1.2 KB  |  51 lines

  1. unit Tools_Custom;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Base, StdCtrls, TeEngine, Series, ExtCtrls, TeeProcs, Chart, TeeTools;
  8.  
  9. type
  10.   TAxisLabelToolDemo = class(TBaseForm)
  11.     Series1: TBarSeries;
  12.     CheckBox1: TCheckBox;
  13.     procedure FormCreate(Sender: TObject);
  14.     procedure CheckBox1Click(Sender: TObject);
  15.   private
  16.     { Private declarations }
  17.   public
  18.     { Public declarations }
  19.   end;
  20.  
  21. implementation
  22.  
  23. {$R *.DFM}
  24.  
  25. Uses TeeAxisLabelTool;  { <-- here it is the custom tool... }
  26.  
  27. procedure TAxisLabelToolDemo.FormCreate(Sender: TObject);
  28. Var AxisLabelTool : TAxisLabelTool;
  29. begin
  30.   inherited;
  31.   { sample values for the series }
  32.   Series1.AddArray([8,800,150,1500,2000,1000,120000,30000]);
  33.  
  34.   { create the custom tool }
  35.   AxisLabelTool:=TAxisLabelTool.Create(Self);
  36.   { set the chart }
  37.   AxisLabelTool.ParentChart:=Chart1;
  38.  
  39.   { set the tool axis }
  40.   AxisLabelTool.Axis:=Chart1.LeftAxis;
  41. end;
  42.  
  43. procedure TAxisLabelToolDemo.CheckBox1Click(Sender: TObject);
  44. begin
  45.   Chart1.Tools[0].Active:=CheckBox1.Checked;
  46. end;
  47.  
  48. initialization
  49.   RegisterClass(TAxisLabelToolDemo);
  50. end.
  51.