[Lazarus] New unit with resource with some components on it by default

Joost van der Sluis joost at cnoc.nl
Tue Nov 30 13:15:19 CET 2010

On Mon, 2010-11-29 at 10:34 +0100, Mattias Gaertner wrote:
> On Mon, 29 Nov 2010 10:21:07 +0100
> Joost van der Sluis <joost at cnoc.nl> wrote:
> > Hi all,
> > 
> > Is it possible to add a 'new module' option to the ide which has by
> > default some components on it?
> > 
> > With a TFileDescPascalUnitWithResource, it is possible to add a new
> > module type, but I can't find out a way to add some components on it by
> > default. (I could add the definitions to the code, offcourse, but how to
> > add them to the resource?)
> You can specify the lfm. Override the method GetResourceSource.

Thanks. It has a bug, though. If I use it to generate something else
then a form, using a designer. It still handles the component/resource
as if it was a form. 

That's because CreateRawComponentFromStream is called for the just
generated resource. Which assumes a form. CreateNewForm, on the other
hand, handles the non-lcl-component right. (CreateNewForm is used when
there's no resource-content given)

Shall I create a bug-report?


More information about the Lazarus mailing list