{*********************************************}
{  TeeChart Charting Library for FireMonkey   }
{  Copyright (c) 2012-2020 by Steema Software }
{  All Rights Reserved                        }
{*********************************************}
unit FMXTee.About;
{$I TeeDefs.inc}

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes,
  System.Variants, FMX.Types, FMX.Controls, FMX.Forms,
  {$IFNDEF UPTOXE3}
  FMX.Forms3D, FMX.Controls3D, FMX.MaterialSources,
  {$ENDIF}
  FMX.Dialogs, FMX.Types3D, FMX.Objects3D, FMX.Ani, FMXTee.Chart3D,
  {$IFDEF D17}
  FMX.Materials,
  {$ENDIF}
  FMX.Layers3D, FMXTee.Engine, FMXTee.Procs, FMXTee.Chart, FMXTee.Series;

type
  TFormAbout = class(TForm3D)
    LVersion: TText3D;
    Chart3D1: TChart3D;
    FloatAnimation2: TFloatAnimation;
    Series1: TBarSeries;
    Image3D1: TImage3D;
    TextOffer: TText3D;
    FloatAnimation4: TFloatAnimation;
    procedure Form3DCreate(Sender: TObject);
    procedure Text3D3Click(Sender: TObject);
    procedure Form3DActivate(Sender: TObject);
    procedure Form3DKeyUp(Sender: TObject; var Key: Word; var KeyChar: Char;
      Shift: TShiftState);
  private
    { Private declarations }
  public
    { Public declarations }
    class procedure About(const AOwner:TComponent);
  end;

var
  TeeIsTrial : Boolean=False;

implementation

{$R *.fmx}

uses
  FMXTee.Constants;

class procedure TFormAbout.About(const AOwner: TComponent);
begin
  with TFormAbout.Create(AOwner) do
  try
    ShowModal;
  finally
    Free;
  end;
end;

procedure TFormAbout.Form3DActivate(Sender: TObject);
begin
  {$IFNDEF D17}
  // Workaround XE2 bug:
  Light1.Parent:=nil;
  Light1.Parent:=Self;
  {$ENDIF}
end;

procedure TFormAbout.Form3DCreate(Sender: TObject);
var Light1 : TLight;
begin
  // Light1 created here to skip XE6 problem with unprefixed LightType
  // (no "alias" for enum values)
  Light1:=TLight.Create(Self);
  Light1.Color:=TAlphaColorRec.White;
  Light1.LightType:=TLightType.{$IFDEF D20}Spot{$ELSE}ltSpot{$ENDIF};
  Light1.SpotCutOff:=60;
  Light1.SpotExponent:=4;
  Light1.Position.X:=0.936;
  Light1.Position.Y:=-6.855;
  Light1.Position.Z:=-18.07;
  Light1.RotationAngle.X:=322.11;
//  Light1.Quanternion := '(-0.324662953615189,0,0,0.945829749107361)';

  Light1.Parent:=Self;

  LVersion.Text:=TeeMsg_Version;

  {$IFDEF TEELITEEMB}
  TextOffer.Text:=TeeRADXE2_SpecialOffer;
  {$ELSE}
  TextOffer.Visible:=False;
  {$ENDIF}

  // QC112375
  TextOffer.Visible:=False;
end;

procedure TFormAbout.Form3DKeyUp(Sender: TObject; var Key: Word;
  var KeyChar: Char; Shift: TShiftState);
begin
  if Key=vkEscape then
     Close;
end;

procedure TFormAbout.Text3D3Click(Sender: TObject);
begin
  TeeGotoURL({$IFDEF D18}NativeUInt{$ENDIF}(Handle),
             {$IFDEF TEELITEEMB}TeeRADXE2_SpecialWWW{$ELSE}'http://www.steema.com'{$ENDIF});
end;

end.
