unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, TeEngine, Series, TeeProcs, Chart, DBChart,
  StdCtrls, DBCtrls, ExtCtrls, DB, DBTables;

type
  TForm1 = class(TForm)
    Table1: TTable;
    DataSource1: TDataSource;
    Panel1: TPanel;
    DBNavigator1: TDBNavigator;
    CheckBox1: TCheckBox;
    Panel2: TPanel;
    Panel3: TPanel;
    DBGrid1: TDBGrid;
    DBGrid2: TDBGrid;
    Table2: TTable;
    DBChart1: TDBChart;
    Series1: TAreaSeries;
    Button1: TButton;
    DataSource2: TDataSource;
    procedure DBGrid1CellClick(Column: TColumn);
    procedure CheckBox1Click(Sender: TObject);
    procedure DBNavigator1Click(Sender: TObject; Button: TNavigateBtn);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.DBGrid1CellClick(Column: TColumn);
begin
DBChart1.RefreshData;
end;

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
Table1.Active := CheckBox1.Checked;
Table2.Active := CheckBox1.Checked;
end;

procedure TForm1.DBNavigator1Click(Sender: TObject; Button: TNavigateBtn);
begin
DBChart1.RefreshData;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Application.Terminate;
end;

end.
