home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1999 February
/
PCWorld_1999-02_cd.bin
/
temacd
/
HotKeys
/
AboutEdt.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-02-14
|
2KB
|
97 lines
unit AboutEdt;
interface
uses
WinTypes, WinProcs, Classes, Graphics, Forms, Controls,
StdCtrls, ExtCtrls, Buttons, DsgnIntf, AboutPrp;
type
TAboutPropertyEditor = class(TPropertyEditor)
public
procedure Edit; override;
function GetAttributes: TPropertyAttributes; override;
function GetValue: string; override;
end;
TAboutPropertyDlg = class(TForm)
btnOk: TButton;
pnlFrame: TPanel;
lblCopyright: TLabel;
btnPaletteBmp: TSpeedButton;
lblDescription: TLabel;
lblCompany: TLabel;
bvlSeparatorLine: TBevel;
pbxComponentName: TPaintBox;
procedure pbxComponentNamePaint(Sender: TObject);
private
FAboutInfo : TAboutInfo;
procedure SetAboutInfo(Value: TAboutInfo);
public
ComponentName : string;
property AboutInfo : TAboutInfo read FAboutInfo write SetAboutInfo;
end;
implementation
{$R *.DFM}
uses
SysUtils;
function TAboutPropertyEditor.GetAttributes: TPropertyAttributes;
begin
Result := [paDialog, paReadOnly];
end;
function TAboutPropertyEditor.GetValue: string;
begin
Result := 'Press ... to Display';
end;
procedure TAboutPropertyEditor.Edit;
var
Dialog: TAboutPropertyDlg;
begin
Dialog := TAboutPropertyDlg.Create(Application);
try
Dialog.ComponentName := GetComponent(0).ClassName;
Dialog.AboutInfo := TAboutInfo(GetOrdValue);
Dialog.ShowModal;
finally
Dialog.Free;
end;
end;
procedure TAboutPropertyDlg.SetAboutInfo(Value: TAboutInfo);
begin
lblCopyright.Caption := 'Copyright ⌐ '+ Value.CopyrightDate;
lblCompany.Caption := Value.Company;
lblDescription.Caption := Value.Description;
btnPaletteBmp.Glyph.Handle := LoadBitmap(HInstance, PChar(UpperCase(ComponentName)));
if ComponentName[1] = 'T' then Delete(ComponentName, 1, 1);
Caption := 'About the ' + ComponentName + ' component';
end;
procedure TAboutPropertyDlg.pbxComponentNamePaint(Sender: TObject);
begin
with pbxComponentName.Canvas do
begin
Font.Name := 'Times New Roman';
Font.Size := 18;
SetBkMode(Handle, TRANSPARENT);
Font.Color := clBtnShadow;
TextOut(2, 2, ComponentName);
Font.Color := clWindowText;
TextOut(0, 0, ComponentName);
end;
end;
end.