Sign in Join

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

Mailing lists / lazarus / 2022-05

Simplest way to update a .lfm using a Component Editor

6 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Marcos Douglas B. Santos

Hello,
I wrote a component which has a Component Editor.
How is the simplest way to update the .lfm form, using this Component Editor?
I took a look in fieldseditor to get some example, but I guess the code there is more complicated than I need it.

best regards,
Marcos Douglas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20220520/68f64f9f/attachment.htm>

Reply by email

Mattias Gaertner
to Marcos Douglas B. Santos

On Fri, 20 May 2022 11:28:59 -0300
"Marcos Douglas B. Santos via lazarus"

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"?

I took a look in fieldseditor to get some example, but I guess the code there is more complicated than I need it.

Mattias

Reply by email

Marcos Douglas B. Santos
to Mattias Gaertner
AM Mattias Gaertner wrote 11 lines
On Fri, 20 May 2022 11:28:59 -0300 "Marcos Douglas B. Santos via lazarus" 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

Marcos Douglas

Reply by email

Marcos Douglas B. Santos
to Marcos Douglas B. Santos
PM Marcos Douglas B. Santos wrote 24 lines
On Fri, May 20, 2022 at 11:50 AM Mattias Gaertner via lazarus wrote: > > On Fri, 20 May 2022 11:28:59 -0300 > "Marcos Douglas B. Santos via lazarus" > 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.

Marcos Douglas

Reply by email

Marcos Douglas B. Santos
to Marcos Douglas B. Santos
PM Marcos Douglas B. Santos wrote 36 lines
On Fri, May 20, 2022 at 12:00 PM Marcos Douglas B. Santos wrote: > > On Fri, May 20, 2022 at 11:50 AM Mattias Gaertner via lazarus > wrote: > > > > On Fri, 20 May 2022 11:28:59 -0300 > > "Marcos Douglas B. Santos via lazarus" > > 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...

Marcos Douglas

Reply by email

Marcos Douglas B. Santos
to Marcos Douglas B. Santos
PM Marcos Douglas B. Santos wrote 44 lines
On Fri, May 20, 2022 at 12:38 PM Marcos Douglas B. Santos wrote: > > On Fri, May 20, 2022 at 12:00 PM Marcos Douglas B. Santos > wrote: > > > > On Fri, May 20, 2022 at 11:50 AM Mattias Gaertner via lazarus > > wrote: > > > > > > On Fri, 20 May 2022 11:28:59 -0300 > > > "Marcos Douglas B. Santos via lazarus" > > > 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

Reply by email