home *** CD-ROM | disk | FTP | other *** search
- unit AboutDlg;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, About;
-
- type
- TAboutBoxDlg = class(TComponent)
- private
- { Private declarations }
- FProductName, FVersion, FCopyright, FComments: string;
- protected
- { Protected declarations }
- public
- { Public declarations }
- function Execute: Boolean;
- published
- { Published declarations }
- property ProductName: string read FProductName write FProductName;
- property Version: string read FVersion write FVersion;
- property Copyright: string read FCopyright write FCopyright;
- property Comments: string read FComments write FComments;
- end;
-
- procedure Register;
-
- implementation
-
- function TAboutBoxDlg.Execute: Boolean;
- begin
- AboutBox := TAboutBox.Create(Application);
- try
- if ProductName = '' then ProductName := Application.Title;
- AboutBox.ProductName.Caption := ProductName;
- AboutBox.Version.Caption := Version;
- AboutBox.Copyright.Caption := Copyright;
- AboutBox.Comments.Caption := Comments;
- with AboutBox do
- begin
- Caption := 'About ' + Self.ProductName;
- ProgramIcon.Picture.Graphic := Application.Icon;
- Result := ShowModal = mrOK;
- end;
- finally
- AboutBox.Free;
- end;
- end;
-
- procedure Register;
- begin
- RegisterComponents('Samples', [TAboutBoxDlg]);
- end;
-
- end.
-