[Lazarus] Simplest way to update a .lfm using a Component Editor
Marcos Douglas B. Santos
md at delfire.net
Fri May 20 19:58:42 CEST 2022
On Fri, May 20, 2022 at 12:58 PM Marcos Douglas B. Santos
<md at delfire.net> wrote:
>
> On Fri, May 20, 2022 at 12:38 PM Marcos Douglas B. Santos
> <md at delfire.net> wrote:
> >
> > On Fri, May 20, 2022 at 12:00 PM Marcos Douglas B. Santos
> > <md at delfire.net> wrote:
> > >
> > > On Fri, May 20, 2022 at 11:50 AM Mattias Gaertner via lazarus
> > > <lazarus at lists.lazarus-ide.org> wrote:
> > > >
> > > > On Fri, 20 May 2022 11:28:59 -0300
> > > > "Marcos Douglas B. Santos via lazarus" <lazarus at lists.lazarus-ide.org>
> > > > wrote:
> > > >
> > > > > Hello,
> > > > > I wrote a component which has a Component Editor.
> > > > > How is the simplest way to update the .lfm form, using this Component
> > > > > Editor?
> > > >
> > > > What do you mean with "update the lfm"?
> > >
> > > If the Component Editor (CE) changes some property on its owner
> > > (component), it doesn't reflect on form .lfm where this component is.
> > > If the CE changes something, I would like that the IDE enabled "Save
> > > button"; then, saving the form .lfm, it will be modified.
> > >
> > > For example, I was search some example on fieldseditor, fieldslist,
> > > newfield units—as the "Field Editor" creates fields in .lfm when user
> > > close it—uses a lot FDesigner instance such
> > > FDesigner.PropertyEditorHook.PersistendAdded, FDesigner.Modified, etc
> >
> > Ok, I realized that my problem depends on the case. Another Component
> > Editor (CE), for another component works.
> > So, I think I need to give more details: the problem occurs using a CE
> > for a ToolBar descendent.
> > The CE can add/delete/order the buttons. After user close CE using
> > mrOK, the code remove all buttons, then include new ones
> > https://github.com/tranquilit/pltis_uicomponents/blob/master/src/standard/tis.ui.toolbar.editor.pas#L146-L166
> > but it doesn't reflect on IDE.
>
> All right, I guess I need to add new buttons as
> TToolBarComponentEditor does, I mean, using Hook.PersistentAdded and
> Modified at the end.
> I will tell you when I have news...
I was right about PersistentAdded... anyway, it's working now
https://github.com/tranquilit/pltis_uicomponents/commit/f977bf24077f0cad56c02b8ffdf5b834c8800441
Sorry the noise.
Marcos Douglas
More information about the lazarus
mailing list