
21.01.2010, 14:54
|
 |
Местный
|
|
Регистрация: 12.03.2006
Адрес: Минск
Сообщения: 527
Репутация: 1336
|
|
Вот тебе кусок кода с моего старого проекта, разбирайся.
Код:
{$I versions.inc}
{$D-,L-,Y-}
unit uEditor;
interface
uses
Windows, Classes, Forms, Controls, ExptIntf, TypInfo, ToolIntf,
EditIntf, VirtIntf, SysUtils, Dialogs, ExtCtrls,
{$IFDEF DELPHI5_OR_ABOVE}
ToolsApi,
{$ENDIF}
{$IFNDEF DELPHI6_OR_ABOVE}
DsgnIntf,
{$ELSE}
DesignIntf,
DesignEditors,
VCLEditors,
{$ENDIF}
StdCtrls,
Graphics;
type
TAboutProperty = class(TClassProperty)
public
procedure Edit; override;
function GetAttributes: TPropertyAttributes; override;
function GetValue: string; override;
{$IFDEF VER130}
procedure PropDrawName(ACanvas: TCanvas; const ARect: TRect;
ASelected: Boolean); override;
{$ENDIF}
end;
implementation
uses uFormAbout;
function TAboutProperty.GetAttributes: TPropertyAttributes;
begin
Result := [paDialog, paReadOnly {$IFDEF DELPHI5_OR_ABOVE}, paFullWidthName {$ENDIF}]
end ;
procedure TAboutProperty.Edit;
var
Form : TFormAbout;
begin
try
Form := TFormAbout.Create(nil);
Form.ShowModal;
finally
Form.Free;
end;
end;
function TAboutProperty.GetValue: string;
begin
Result := '(About)';
end;
{$IFDEF VER130}
procedure TCHAboutProperty.PropDrawName(ACanvas: TCanvas; const ARect: TRect;
ASelected: Boolean);
begin
ACanvas.Font.Style := [fsBold];
inherited PropDrawName(ACanvas, ARect, ASelected);
end;
{$ENDIF}
end.
__________________
Нет повести печальнее на свете, чем повесть о заклиневшем Resete.
|