Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-02

Codetools check lfm bug?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

patspiper

Hi,

'Tools/Check LFM File in editor' gives the error 'identifier Strings is not published in class TStringListDescendant'

where TStringListDescendant is just a descendant of TStringList. The error does not happen with TStringList itself. Is this a bug?

----------------------------------
TStringListDescendant = class(TStringList)

   end;
   TDesignComponent = class(TComponent)  // <- component registered in
the IDE
   private
     FStringsData: TStrings;
     FStringListData: TStringList;
     FStringListDescendantData: TStringListDescendant;
     procedure SetStringsData(AValue: TStrings);
     procedure SetStringListData(AValue: TStringList);
     procedure SetStringListDescendantData(AValue: TStringListDescendant);
   public
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
   published
     property StringsData: TStrings read FStringsData write SetStringsData;
     property StringListData: TStringList read FStringListData  write
SetStringListData ;
     property StringListDescendantData: TStringListDescendant read
FStringListDescendantData write SetStringListDescendantData;
   end;

lfm (relevant part):
object DesignComponent1: TDesignComponent
StringsData.Strings = (
'1'
)
StringListData.Strings = (
'2'
)
StringListDescendantData.Strings = (
'3'
)
left = 229
top = 48

   end

----------------------------------

Stephano

Reply by email

Mattias Gaertner
to patspiper
Show quoted text 7 lines
Hi, 'Tools/Check LFM File in editor' gives the error 'identifier Strings is not published in class TStringListDescendant' where TStringListDescendant is just a descendant of TStringList. The error does not happen with TStringList itself. Is this a bug?

It's not yet supported.
The Strings property is a runtime property, so there is no clean way to find it at design time. I can imagine several heuristics which could solve this. But since you are the first to ask for this in 10 years, I'm not sure if it is worth the hassle.

I added a semi hack:
Please update svn trunk to 40366. Then call in your designtime package register procedure:

uses
  FormEditingIntf;
...
procedure Register;
begin
  FormEditingHook.RegisterDefineProperty('TStringListDescendant','Strings');
end;

Mattias

Reply by email

patspiper
to Mattias Gaertner
Mattias Gaertner wrote 13 lines
On Fri, 22 Feb 2013 18:07:05 +0200 patspiper wrote: > Hi, > > 'Tools/Check LFM File in editor' gives the error 'identifier Strings is > not published in class TStringListDescendant' > > where TStringListDescendant is just a descendant of TStringList. The > error does not happen with TStringList itself. Is this a bug? It's not yet supported. The Strings property is a runtime property, so there is no clean way to find it at design time.

TStringList is a descendant of TStrings, yet a published TStringList property does not exhibit the error. What makes TStringListDescendant different?

I can imagine several heuristics which could solve this. But since you are the first to ask for this in 10 years, I'm not sure if it is worth the hassle.

Check lfm by itself is not of much use. I encountered the issue while testing the Delphi converter (which checks the lfm/dfm). The converter chokes on it. I can try to code a solution if you guide me.

Show quoted text 12 lines
I added a semi hack: Please update svn trunk to 40366. Then call in your designtime package register procedure: uses FormEditingIntf; ... procedure Register; begin FormEditingHook.RegisterDefineProperty('TStringListDescendant','Strings'); end;

The lfm passes the Check lfm in editor using the semi hack.

Stephano

Reply by email