home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 May
/
VPR9705A.ISO
/
VPR_DATA
/
PROGRAM
/
Delphi
/
Sample
/
ABOUTBOX.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-03-02
|
2KB
|
91 lines
unit AboutBox;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ExtCtrls;
type
TAboutBoxForm = class(TForm)
Panel1: TPanel;
ProgramIcon: TImage;
ProductName: TLabel;
Version: TLabel;
Copyright: TLabel;
BitBtn1: TBitBtn;
private
{ Private 宣言 }
public
{ Public 宣言 }
end;
TAboutBox = class(TComponent)
private
FCopyright: string;
FProductName: string;
FProgramIcon: TIcon;
FVersion: string;
procedure SetProgramIcon(Value: TIcon);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Execute;
published
property Copyright: string read FCopyright write FCopyright;
property ProductName: string read FProductName write FProductName;
property ProgramIcon: TIcon read FProgramIcon write SetProgramIcon;
property Version: string read FVersion write FVersion;
end;
var
AboutBoxForm: TAboutBoxForm;
procedure Register;
implementation
{$R *.DFM}
constructor TAboutBox.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FProgramIcon := TIcon.Create;
end;
destructor TAboutBox.Destroy;
begin
FProgramIcon.Free;
inherited Destroy;
end;
procedure TAboutBox.SetProgramIcon(Value: TIcon);
begin
FProgramIcon.Assign(Value);
end;
procedure TAboutBox.Execute;
begin
AboutBoxForm := TAboutBoxForm.Create(Application);
with AboutBoxForm do
begin
if FProductName = '' then
ProductName.Caption := ExtractFileName(Application.ExeName)
else
AboutBoxForm.ProductName.Caption := FProductName;
Version.Caption := FVersion;
Copyright.Caption := FCopyright;
if not FProgramIcon.Empty then
ProgramIcon.Picture.Assign(FProgramIcon);
ShowModal;
Free;
end;
end;
procedure Register;
begin
RegisterComponents('Samples', [TAboutBox]);
end;
end.