View Issue Details

IDProjectCategoryView StatusLast Update
0000129Lazaruspublic2003-07-17 03:23
ReporterBug ImportAssigned ToMattias Gaertner 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product VersionProduct Build 
Target VersionFixed in Version 
Summary0000129: Foward class reference disables RTTI in property editor
DescriptionDeclaring 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 InformationImported information
--------------------
Name: Tom Lisjac
Mail:
TagsNo tags attached.
Fixed in Revision
LazTarget
WidgetsetGTK, Win32/Win64
Attached Files

Activities

Bug Import

2003-07-17 03:23

reporter   ~0000111

This is not a lazarus bug, but the FPC bug 2492.

Issue History

Date Modified Username Field Change
2003-07-16 00:00 Bug Import New Issue
2003-07-16 00:00 Bug Import Widgetset => GTK, Win32
2003-07-17 03:23 Bug Import Status new => assigned
2003-07-17 03:23 Bug Import Assigned To => Mattias Gaertner
2003-07-17 03:23 Bug Import Note Added: 0000111
2003-07-17 03:23 Bug Import Status new => closed
2003-07-17 03:23 Bug Import Resolution open => no change required