unit UView;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ComCtrls;

type
  TFView = class(TForm)
    CheckBox1: TCheckBox;
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    TBRotation: TTrackBar;
    TBElevation: TTrackBar;
    Label3: TLabel;
    TBPerspective: TTrackBar;
    TBZoom: TTrackBar;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    TBTilt: TTrackBar;
    Label10: TLabel;
    procedure TBRotationChange(Sender: TObject);
    procedure CheckBox1Click(Sender: TObject);
    procedure TBElevationChange(Sender: TObject);
    procedure TBPerspectiveChange(Sender: TObject);
    procedure TBZoomChange(Sender: TObject);
    procedure TBTiltChange(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FView: TFView;

implementation

uses UPlots;

{$R *.DFM}

procedure TFView.TBRotationChange(Sender: TObject);
begin
 Form1.Chart1.View3dOptions.Rotation := TBRotation.Position;
 Label5.Caption := IntToStr(TBRotation.Position);
end;

procedure TFView.CheckBox1Click(Sender: TObject);
begin
 Form1.Chart1.View3dOptions.Orthogonal := CheckBox1.Checked;
 GroupBox1.Enabled := not CheckBox1.Checked;
 if not CheckBox1.Checked
 then begin
  TBRotationChange(Sender);
  TBElevationChange(Sender);
  TBPerspectiveChange(Sender);
  TBTiltChange(Sender);
 end;
end;

procedure TFView.TBElevationChange(Sender: TObject);
begin
 Form1.Chart1.View3dOptions.Elevation := TBElevation.Position;
 Label6.Caption := IntToStr(TBElevation.Position);
end;

procedure TFView.TBPerspectiveChange(Sender: TObject);
begin
 Form1.Chart1.View3dOptions.Perspective := TBPerspective.Position;
 Label7.Caption := IntToStr(TBPerspective.Position);
end;

procedure TFView.TBZoomChange(Sender: TObject);
begin
 Form1.Chart1.View3dOptions.Zoom := TBZoom.Position;
 Label8.Caption := IntToStr(TBZoom.Position);
end;

procedure TFView.TBTiltChange(Sender: TObject);
begin
 Form1.Chart1.View3dOptions.Tilt := TBTilt.Position;
 Label10.Caption := IntToStr(TBTilt.Position);
end;

end.
