Я начал строить новый компонент в Delphi 6 Pro. В настоящее время он просто имеет Один из опубликованной имущества TFONT. Тем не менее, когда я бросаю компонент в виде в форме проекта, и нажмите кнопку «Изменить» для свойства «TEXTATTR_1» (ELLIPSIS), я получаю исключение «Невозможно назначить NIL TFONT». Что я делаю не так, что вызывает эту ошибку? Ниже приведен код для компонента:
unit JvExtendedTextAttributes;
interface
uses
Windows, Messages, SysUtils, Classes, JvRichEdit, Graphics;
type
TJvExtendedTextAttributes = class(TComponent)
private
{ Private declarations }
protected
{ Protected declarations }
FTextAttr_1: TFont;
public
{ Public declarations }
constructor Create(AOwner: TComponent);
published
{ Published declarations }
property textAttr_1: TFont read FTextAttr_1 write FTextAttr_1;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('FAVORITES', [TJvExtendedTextAttributes]);
end;
// ---------------------------------------------------------------
constructor TJvExtendedTextAttributes.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FTextAttr_1 := TFont.Create;
end;
// ---------------------------------------------------------------
end.