[Lazarus] Accessing the FormEditor from within a non-lcl designer
Michael Van Canneyt
michael at freepascal.org
Fri Nov 12 15:51:06 CET 2010
On Fri, 12 Nov 2010, Mattias Gaertner wrote:
> On Fri, 12 Nov 2010 15:15:01 +0100
> Joost van der Sluis <joost at cnoc.nl> wrote:
>
>> Hi all, Mattias,
>>
>> I would like to use FormEditor.CreateComponent and
>> FormEditor.CreateuniqueComponentName from within a designer-mediator. So
>> I don't have to duplicate that code.
>>
>> How can I do this? I've tried it using LCLForm.Designer.TheFormEditor,
>> but this is not possible because the TheFormEditor property is defined
>> in the designer.pp unit, which I can not use in a package.
>> I've tried to move the TheFormEditor property to the
>> ComponentEditorDesigner class, but that leads to circular
>> unit-references.
>>
>> I can try to find some solution, but maybe you know a better one?
>
> Maybe:
> http://wiki.lazarus.freepascal.org/Extending_the_IDE#Create_a_new_unique_component_name
It may be a good idea to create a CreateUniqueChildName in TComponent ?
I find myself creating such a function at regular intervals.
Michael.
More information about the Lazarus
mailing list