Index » Empathy Jukebox : Blob d48ec1 / warn.pas
unit warn;

interface

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

type
  Twarnform = class(TForm)
    OK: TButton;
    maintext: TLabel;
    remember: TCheckBox;
    sectext: TLabel;
    hyperlink: TLabel;
    procedure FormActivate(Sender: TObject);
    procedure hyperlinkClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  warnform: Twarnform;
  aurl : string;
  ww : boolean;

function showwarning(caption : string; main : string;secondary : string;urltext : string;url : string;w : boolean) : boolean; export;

implementation
uses main;

{$R *.DFM}

function showwarning(caption : string; main : string;secondary : string;urltext : string;url : string;w : boolean) : boolean; export;
begin
warnform:=twarnform.create(application);
  try
    warnform.caption:=caption;
    warnform.maintext.caption:=main;
    warnform.sectext.caption:=secondary;
    warnform.hyperlink.caption:=urltext;
    aurl:=url;
    ww:=w;
    warnform.Showmodal;
    finally
       result:=not warnform.remember.checked;
      warnform.Free;
  end;
end;



procedure Twarnform.FormActivate(Sender: TObject);
begin
if aurl='' then hyperlink.visible:=false;
if ww=false then remember.visible:=false else remember.visible:=true;
end;

procedure Twarnform.hyperlinkClick(Sender: TObject);
begin
ShellExecute (0, nil, pchar(aurl), nil, nil, SW_SHOWNORMAL);
end;

end.