[lazarus] Bug Report Update
bugtracker at miraclec.com
bugtracker at miraclec.com
Wed Jul 16 15:47:54 EDT 2003
Title: Foward class reference disables RTTI in property editor
Entered by: Tom Lisjac
Original Description:
Declaring a forward class reference for a component masks access to it in the property editor after it is installed. The component runs fine if manually initialized at runtime but the property editor is completely blank when viewing it in the IDE at design time. An example is attached that reproduces the problem.
A workaround that restores design time access is to remove the forward reference, declare generic pointers and typecast them where needed.
unit fwdtest;
interface
uses
SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TMain = class;
TMainXprops = class(TPersistent)
private
fParent:TMain;
finteger:integer;
fString: String;
published
property Parent :TMain read fParent write fParent;
property AnInteger:Integer read finteger write finteger;
property AString:String read fString write fString;
end;
TMain = class(TComponent)
private
fy:TMainXProps;
Public
Constructor Create(AOwner:TComponent); Override;
Destructor Destroy; Override;
published
property testprop:TMainXProps read fy write fy;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Misc', [TMain]);
end;
{ TMain }
constructor TMain.Create(AOwner: TComponent);
begin
inherited;
fy:=TMainXProps.Create;
end;
destructor TMain.Destroy;
begin
fy.free;
inherited;
end;
end.
Updated by: Mattias
Status: Not a bug
Comments:
This is not a lazarus bug, but the FPC bug 2429.
More information about the Lazarus
mailing list