{
  ==================================================

    AboutDlg.pas
    ------------

    Verze 1.20
    Copyright © 2000-02 David Majda

  ==================================================
}

unit AboutDlg;

interface

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

type
  TAboutDlg = class(TForm)
    NameLabel: TLabel;
    VersionLabel: TLabel;
    IconImage: TImage;
    CopyrightLabel: TLabel;
    OKBtn: TButton;
    Bevel1: TBevel;
    Panel: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    EmailLabel: TLabel;
    WWWLabel: TLabel;
    Bevel2: TBevel;
    Label3: TLabel;
    Label4: TLabel;
    AdditionalMemo: TMemo;
    procedure EmailLabelMouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure WWWLabelMouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure EmailLabelClick(Sender: TObject);
    procedure WWWLabelClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

function ShowAboutDlg(AppName, AppVersion, AppCopyright, AppAdditionalText,
  AppEmail, AppWWW: string): Boolean;

implementation

{$R *.DFM}

uses
  ShellAPI, Tahoma;

function ShowAboutDlg(AppName, AppVersion, AppCopyright, AppAdditionalText,
  AppEmail, AppWWW: string): Boolean;
var
  AboutDlg: TAboutDlg;
begin
  AboutDlg := TAboutDlg.Create(Application);
  with AboutDlg do
    try
      NameLabel.Caption := AppName;
      VersionLabel.Caption := 'Verze ' + AppVersion;
      CopyrightLabel.Caption := AppCopyright;
      IconImage.Picture.Icon := Application.Icon;
      EmailLabel.Caption := AppEmail;
      WWWLabel.Caption := AppWWW;

      if AppAdditionalText = '' then
      begin
        ClientHeight := 184;
        Bevel2.Top := 138;
        Panel.Height := 66;
        OKBtn.Top := 150;
      end
      else
        AdditionalMemo.Text := AppAdditionalText;

      Result := ShowModal = mrOk;
    finally
      Free;
    end;
end;

procedure TAboutDlg.EmailLabelMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  EmailLabel.Font.Color := clRed;
  WWWLabel.Font.Color := clBlue;
end;

procedure TAboutDlg.WWWLabelMouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
  EmailLabel.Font.Color := clBlue;
  WWWLabel.Font.Color := clRed;
end;

procedure TAboutDlg.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  EmailLabel.Font.Color := clBlue;
  WWWLabel.Font.Color := clBlue;
end;

procedure TAboutDlg.EmailLabelClick(Sender: TObject);
begin
  ShellExecute(Handle, nil, PChar('mailto:' + EmailLabel.Caption), nil, nil, SW_SHOW);
end;

procedure TAboutDlg.WWWLabelClick(Sender: TObject);
begin
  ShellExecute(Handle, nil, PChar(WWWLabel.Caption), nil, nil, SW_SHOW);
end;

procedure TAboutDlg.FormCreate(Sender: TObject);
begin
  TahomizeForm(Self);
  LightenControl(Panel);
end;

end.
