unit fuQExport4About;

{$I QExport4VerCtrl.inc}

interface

uses
  {$IFDEF VCL16}
    System.Classes,
    Vcl.Graphics,
    Vcl.Controls,
    Vcl.Forms,
    Vcl.StdCtrls,
    Vcl.Buttons,
    Vcl.ExtCtrls;
  {$ELSE}
    Classes,
    Graphics,
    Controls,
    Forms,
    StdCtrls,
    Buttons,
    ExtCtrls;
  {$ENDIF}

type
  TfmQExport4About = class(TForm)
    lbVerInfo: TLabel;
    BitBtn1: TBitBtn;
    lbCopyRight: TLabel;
    Image1: TImage;
    laDevelopers: TLabel;
    lbCompanyHomePageTag: TLabel;
    lbProductHomePageTag: TLabel;
    lbCompanyHomePage: TLabel;
    lbProductHomePage: TLabel;
    GroupBox1: TGroupBox;
    lbVersion: TLabel;
    lbRegisterNow: TLabel;
    lbLicense: TLabel;
    Panel1: TPanel;
    laWarn: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure lbCompanyHomePageClick(Sender: TObject);
    procedure lbRegisterNowClick(Sender: TObject);
    procedure lbLicenseClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

procedure ShowAboutForm;

implementation

uses
  {$IFDEF VCL16}
    Winapi.Windows,
    Winapi.ShellAPI,
    System.SysUtils,
  {$ELSE}
    Windows,
    ShellAPI,
    SysUtils,
  {$ENDIF}
  QExport4Common, fuQExport4License;

{$R *.DFM}

procedure ShowAboutForm;
begin
  with TfmQExport4About.Create(nil) do
  try
    lbVerInfo.Caption := Format(S_FULL_PRODUCT_NAME,
      [' (version ' + S_VERSION_NUMBER + ')']);
    lbCopyRight.Caption := S_COPYRIGHT;
    ShowModal;
  finally
    Free;
  end;
end;

procedure TfmQExport4About.FormCreate(Sender: TObject);
begin
  lbVersion.Caption := S_VERSION;
{$IFNDEF ADVANCED_DATA_EXPORT_TRIAL_VERSION}
  lbVersion.Font.Color := clBlack;
  lbRegisterNow.Visible := False;
{$ENDIF}
end;

procedure TfmQExport4About.lbCompanyHomePageClick(Sender: TObject);
begin
  ShellExecute(Handle, 'open',
               PChar((Sender as TLabel).Caption),
               nil, nil, SW_SHOW);
end;

procedure TfmQExport4About.lbRegisterNowClick(Sender: TObject);
begin
  ShellExecute(Handle, 'open',
               PChar(S_REG_URL),
               nil, nil, SW_SHOW);
end;

procedure TfmQExport4About.lbLicenseClick(Sender: TObject);
begin
  with TfmQExport4License.Create(nil) do
  try
    ShowModal;
  finally
    Free;
  end;
end;

end.
