home *** CD-ROM | disk | FTP | other *** search
- unit Ugallery;
-
- { Showing a customized TeeChart gallery. }
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, TeEngine, Series, StdCtrls, ExtCtrls, TeeProcs, Chart;
-
- type
- TCustomGalleryForm = class(TForm)
- Chart1: TChart;
- Button1: TButton;
- Button2: TButton;
- Show3D: TCheckBox;
- ShowFunctions: TCheckBox;
- ShowDefault: TCheckBox;
- Series1: TPointSeries;
- procedure Button2Click(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- Procedure ShowMyGallery;
- end;
-
- var
- CustomGalleryForm: TCustomGalleryForm;
-
- implementation
-
- {$R *.DFM}
-
- Uses TeeGally; { <-- the gallery code is in this unit }
-
- Procedure TCustomGalleryForm.ShowMyGallery;
- var tmp:TChartSeries;
- begin
- With TTeeGallery.Create(Self) do { <-- create the gallery }
- try
- { first thing to do, set chart types...}
- CreateGalleryList([ TBarSeries,
- TLineSeries,
- TPointSeries,
- TPieSeries ]);
-
- { rows and columns... }
- GalleryPanel.NumCols:=2;
- GalleryPanel.NumRows:=2;
-
- { dimensions... }
- Width:=320;
- Height:=320;
-
- { show 3D? }
- CB3D.Checked:=Show3D.Checked;
-
- { show Default? }
- if ShowDefault.Checked then
- GalleryPanel.SelectedSeries:=Series1;
-
- { show Functions? }
- if not ShowFunctions.Checked then HideFunctions;
-
- { run... }
- if ShowModal=mrOk then
- begin
- { change the Series class choosen by the user... }
- tmp:=Series1;
- ChangeSeriesType(tmp,TChartSeriesClass(GalleryPanel.SelectedChart[0].ClassType));
- end;
- finally
- Free;
- end;
- end;
-
- procedure TCustomGalleryForm.Button2Click(Sender: TObject);
- begin
- Close;
- end;
-
- procedure TCustomGalleryForm.Button1Click(Sender: TObject);
- begin
- ShowMyGallery;
- end;
-
- procedure TCustomGalleryForm.FormCreate(Sender: TObject);
- begin
- Series1.FillSampleValues(10);
- end;
-
- end.
-