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

  1. unit Line_Clickable;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Base, StdCtrls, TeEngine, Series, ExtCtrls, TeeProcs, Chart;
  8.  
  9. type
  10.   TLineClickableForm = class(TBaseForm)
  11.     Series1: TLineSeries;
  12.     CheckBox1: TCheckBox;
  13.     Label1: TLabel;
  14.     procedure FormCreate(Sender: TObject);
  15.     procedure CheckBox1Click(Sender: TObject);
  16.     procedure Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
  17.       Y: Integer);
  18.   private
  19.     { Private declarations }
  20.   public
  21.     { Public declarations }
  22.   end;
  23.  
  24. var
  25.   LineClickableForm: TLineClickableForm;
  26.  
  27. implementation
  28.  
  29. {$R *.DFM}
  30.  
  31. procedure TLineClickableForm.FormCreate(Sender: TObject);
  32. begin
  33.   inherited;
  34.   Series1.FillSampleValues(8);
  35.   Series1.ClickableLine:=False;
  36. end;
  37.  
  38. procedure TLineClickableForm.CheckBox1Click(Sender: TObject);
  39. begin
  40.   Series1.ClickableLine:=CheckBox1.Checked
  41. end;
  42.  
  43. procedure TLineClickableForm.Chart1MouseMove(Sender: TObject;
  44.   Shift: TShiftState; X, Y: Integer);
  45. var tmp : Integer;
  46. begin
  47.   tmp:=Series1.Clicked(x,y);
  48.   if tmp=-1 then Label1.Caption:=''
  49.             else Label1.Caption:='Point: '+IntToStr(tmp);
  50. end;
  51.  
  52. initialization
  53.   RegisterClass(TLineClickableForm);
  54. end.
  55.