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

  1. unit Contour_Palette;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Base, StdCtrls, TeEngine, TeeSurfa, ExtCtrls, TeeProcs, Chart;
  8.  
  9. type
  10.   TContourPaletteForm = class(TBaseForm)
  11.     Series1: TContourSeries;
  12.     Label1: TLabel;
  13.     ComboBox1: TComboBox;
  14.     procedure FormCreate(Sender: TObject);
  15.     procedure ComboBox1Change(Sender: TObject);
  16.     procedure FormShow(Sender: TObject);
  17.   private
  18.     { Private declarations }
  19.   public
  20.     { Public declarations }
  21.   end;
  22.  
  23. implementation
  24.  
  25. {$R *.DFM}
  26.  
  27. procedure TContourPaletteForm.FormCreate(Sender: TObject);
  28. begin
  29.   inherited;
  30.   Series1.FillSampleValues(25);
  31. end;
  32.  
  33. procedure TContourPaletteForm.ComboBox1Change(Sender: TObject);
  34. begin
  35.   Case ComboBox1.ItemIndex of
  36.     0: begin                                 { single color }
  37.          Series1.UseColorRange:=False;
  38.          Series1.UsePalette:=False;
  39.          Series1.SeriesColor:=clYellow;
  40.        end;
  41.     1: begin                                 { gradient 2 colors }
  42.          Series1.UseColorRange:=True;
  43.          Series1.UsePalette:=False;
  44.          Series1.StartColor:=clBlue;
  45.          Series1.EndColor:=clRed;
  46.          Series1.MidColor:=clNone;
  47.        end;
  48.     2: begin                                 { gradient 3 colors }
  49.          Series1.UseColorRange:=True;
  50.          Series1.UsePalette:=False;
  51.          Series1.StartColor:=clBlue;
  52.          Series1.EndColor:=clRed;
  53.          Series1.MidColor:=clYellow;
  54.        end;
  55.     3: begin                                 { palette "pale" }
  56.          Series1.UseColorRange:=False;
  57.          Series1.UsePalette:=True;
  58.          Series1.PaletteStyle:=psPale;
  59.        end;
  60.     4: begin                                 { palette "strong" }
  61.          Series1.UseColorRange:=False;
  62.          Series1.UsePalette:=True;
  63.          Series1.PaletteStyle:=psStrong;
  64.        end;
  65.   end;
  66. end;
  67.  
  68. procedure TContourPaletteForm.FormShow(Sender: TObject);
  69. begin
  70.   inherited;
  71.   ComboBox1.ItemIndex:=2;
  72.   ComboBox1Change(Self);
  73. end;
  74.  
  75. initialization
  76.   RegisterClass(TContourPaletteForm);
  77. end.
  78.