Forum > Designer
How to propagate changes in a frame .lfm to the TFrame referencing it?
Cascade:
When I make a change to a frame .lfm in the IDE form editor, for example renaming a control, any form that is using the frame (via a TFrame object) will no longer open.
I see error messages such as general read error and missing ancestor when trying to open the form in the IDE. Not sure I'm explaining clearly:
So, MyFrame.lfm contains a ListView control, and I rename that control from the default name ListView1 to MyListView. MyForm.lfm will no longer open - it contains a Frame object referencing MyFrame.lfm, but it doesn't seem to know the ancestor name of a control has changed, and is still trying to find an ancestor named ListView1 (?)
How can I get my form to update with the latest changes from the frame .lfm ?
wp:
--- Quote from: Cascade on November 12, 2024, 03:14:19 pm ---When I make a change to a frame .lfm in the IDE form editor, for example renaming a control, any form that is using the frame (via a TFrame object) will no longer open.
--- End quote ---
You are directly editing the lfm file? You should not do this, it is too easy that fatal error slip in this way. When you rename a control in the lfm, for example, you must also rename the form variable in the associated unit.
The correct way is to open the frame's unit in the IDE and do the changes there. Note that when other frames descending from that particular frame are open as well they will not be updated automatically (not 100% sure, though), and you will have to close and reopen these units for this to happen.
cdbc:
Hi
Have a look at this thread post.
...I wish people would /search/ our forum more... ;)
Regards benny
eta: see reply #4 in that thread...
Cascade:
--- Quote ---You are directly editing the lfm file? ... The correct way is to open the frame's unit in the IDE and do the changes there.
--- End quote ---
Thanks, I'm not directly editing the Frame .lfm file, no. I open the frame's unit in the IDE form designer and make the changes visually using the Property Inspector. Sounds like I've got this bit right.
However I am then manually editing the main Form's .lfm file as a last resort, as I can no longer get the IDE to open it after making changes to the frame .lfm that it references.
Thanks for the link to that thread Benny - I will have a good read.
Cascade:
Think I've got it - so I design my frames visually as normal, but assemble them onto the main form only at runtime (basically avoid using the TFrame object in the visual designer, and instantiate TFrames in my code instead). I reckon I can live with that for the time being - will give it a try. Thank you.
Navigation
[0] Message Index
[#] Next page