[Lazarus] help needed making an ide extension
Marc Santhoff
M.Santhoff at web.de
Thu Aug 13 01:24:49 CEST 2015
On Do, 2015-08-13 at 01:06 +0200, Mattias Gaertner wrote:
> On Thu, 13 Aug 2015 00:06:34 +0200
> Marc Santhoff <M.Santhoff at web.de> wrote:
>
> >[...]
> > Good example.
> >
> > I do not fully understand the creation mechanism. I see an extra
> > register procedure in "frmexploremenu.pas" that actually sets the menu
> > entry. I thought a constructor of the extension class would be called.
> > But since it is a modal form that is done by execution of the menu code.
> >
> > Instead there is a notify event "FormCreate()", where is that one
> > called? Is it done that way by convention? Did I miss some piece of
> > documentation?
>
> It is set by the lfm, which is parsed in the forms constructor.
I see, time to activate some code in the IDE instead of only reading it.
> >[...]
> > > It opens all forms of the project.
> >
> > OK, not what I want. What strategy can be used to get a list of forms in
> > the users project without having to open them all?
>
> If you need the list of all units with designer, you can simply search
> for lfm files.
> If you want only specific classes, you have to check each lfm.
Simple and effective. Beautiful.
> >[...]
> > > > Afterwards, will the new component created and have owner, parent and
> > > > essential properties set and then added, like I would do in any other
> > > > program creating components in code at runtime or is there another way
> > > > (sth. like "IDEDoCreateComponetntAndAdd(newcomponent.class)")?
> > >
> > > Maybe such a function can be added to the IDEIntf.
> >
> > In principle making something like "designer/designer.pp
> > TDesigner.MouseUpOnControl AddComponent" publicly available would
> > suffice.
>
> It needs various parameters:
> ComponentClass
> ParentComponent
> Left,Top,
> Optional: Width,Height
> Optional: Name
>
> Would that suffice?
>From my POV it would, although I'm not the most experienced extension
developer. ;)
> > > Can you give some more details what you are trying to achieve?
> >
> > I'm only learning how to do basic actions. Playing around, that is.
> >
> > Currently it is planned to show a list of available forms and let the
> > user select one. Then he would select the parent component for one or
> > more new components to insert.
>
> Just an idea: Why not select the form and parent component, by right
> clicking on the parent component and start the wizard via a menu item
> in the popup menu?
Neat, would save some dialog space and maybe one step. For usability
there should be a menu item at the standard location, but that's another
question.
Thanks again,
Marc
--
Marc Santhoff <M.Santhoff at web.de>
More information about the Lazarus
mailing list