Hello
Hello,
In this sample component
https://github.com/tothpaul/Delphi/blob/master/CollectionTest/CollectionTest.pas
What's wrong with MyProperty.MyCollection, the IDE do not provide a Collection Editor for this sub property :/
In this sample component
https://github.com/tothpaul/Delphi/blob/master/CollectionTest/CollectionTest.pas
What's wrong with MyProperty.MyCollection, the IDE do not provide a Collection Editor for this sub property :/
Shouldn't TMyCollection tell what kind of item it expects?
ReplyDeleteit does : TMyCollection.Create(Self, TMyItem);
ReplyDeletethe property is exactly the same in the two cases, but the IDE provide the editor only for MyComponent.MyCollection, not for MyComponent.MyProperty.MyCollection
Paul TOTH ah, in most my code that part is done by TMyCollection itself. Next try is adding a `initialization
ReplyDeleteRegisterClass(TMyCollection);`
Jeroen Wiert Pluimers done, no change.
ReplyDeletePerhaps the RegisterPropertyEditor do not works for a sub property...
That's one of the things that make me sad with Delphi IDE...I lose a lot of time to make things works at design time.
Odd. I know this works with TStrings in subproperties, but I've no concrete example of a component using a TCollection derived class as a subproperty, and I don't have enough time to do experimentation myself. Maybe David Berneda knows of such a situation?
ReplyDeleteok, found the problem in TCollectionProperty.Edit;
ReplyDeletethe code look for a TComponent Owner of the component...TMyProperty do not override GetOwner method,
code fixed on GitHub
Jeroen Wiert Pluimers oops didn't know about GetOwner fix, I think I've never done a property editor for that case
ReplyDeletePaul TOTH Is the code on github updated with the change about GetOwner?
ReplyDeleteyes
ReplyDeletehttps://github.com/tothpaul/Delphi/blob/master/CollectionTest/CollectionTest.pas#L23
Paul TOTH Thanks
ReplyDelete