Sign in Join

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

Mailing lists / lazarus / 2010-11

Accessing the FormEditor from within a non-lcl designer

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Joost van der Sluis

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?

Joost.

Reply by email

Mattias Gaertner
to Joost van der Sluis
Show quoted text 14 lines
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

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 20 lines
On Fri, 12 Nov 2010 15:15:01 +0100 Joost van der Sluis 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.

Reply by email

Joost van der Sluis
to Mattias Gaertner: On Fri, 12 Nov 2010 15:15:01 +0100 Maybe: http://wiki.lazarus.freepascal.org/Extending_the…
Mattias Gaertner wrote 20 lines
On Fri, 12 Nov 2010 15:15:01 +0100 Joost van der Sluis 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

Perfect, thanks. That's a nice hook. ;)

Joost.

Reply by email