Foward class reference disables RTTI in property editor
Original Reporter info from Mantis: >8<
-
Reporter name: Bug Import
Original Reporter info from Mantis: >8<
- Reporter name: Bug Import
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.
Additional information:
Imported information
--------------------
Name: Tom Lisjac
Mail:
Mantis conversion info:
- Mantis ID: 129