[Lazarus] Sample code needed to create form at runtime only (see mock up below).
Mattias Gaertner
nc-gaertnma at netcologne.de
Fri Sep 10 17:41:02 CEST 2010
On Mon, 6 Sep 2010 10:03:22 +0200
Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
> On 6 September 2010 05:44, Hans-Peter Diettrich <DrDiettrich1 at aol.com> wrote:
> >
> > This is how most *other* GUI designers work, lacking any useful *visual*
> > form designer.
>
> fpGUI being the exception. :-) It has a useful Visual Forms Designer,
> and outputs Object Pascal code in the code unit itself, not in some
> external lfm or dfm file.
>
> I'm pretty sure Mattias made some changes to Lazarus Form Designer
> recently, to allow for such customizations (I know you can use no LCL
> toolkits too)
Yes. Since last year. See here:
http://wiki.lazarus.freepascal.org/Extending_the_IDE#Writing_a_designer_mediator
But at the moment all class names must be unique. So you can not use a
TForm, because the LCL already defines that.
> - not sure how easy it would be to implement though. I
> don't know the code.
There is only a simple pascal stream writer, that does not stream
DefineProperties. There is no pascal stream reader.
So it should be easy to add a function to write a form/component as
pascal code. Of course the missing DefineProperties is quite a show
stopper for LCL controls. But maybe it is still helpful for some
tasks.
Mattias
More information about the Lazarus
mailing list