I am looking at replacing the old custom form constructor with the Delphi form constructor. Our application used a special program to create forms that could be used by our own report author. It's hard to maintain an old application and using Delphi for the form designer seems to be a good option. An application using these forms is also written in Delphi, but these forms will not actually be displayed as real forms, we will just iterate over the components and generate our report.
One of the features of the current form designer is the "neighbor list". The neighbor list keeps track of the next top, bottom, right, and left cells for each cell in the form. The old constructor updates this list when the form is saved at the design stage.
Everything else I need is very easy to track maps according to your typical control properties (position, height, width, etc.). I cannot figure out how to create and save neighbor type information in dfm.
Is there any way for a component on a form during development to have an event fire when something in the form changes? Or an event when the form is saved?
I thought of two approaches to the problem 1) Store the neighbor information in each separate control. It will be some kind of work, but there is still a problem of getting out of sync when other controls on the form move, if I cannot get an event that will tell me when to update.
2) Have a non-visual component that just keeps track of the list. I could add a page for the custom property editor, which also has a refresh button on it that will regenerate the list, but then I would not have to click on it before the final version is saved. I see that this step has been missed and would rather have something that just works.
I could also change the application to dynamically search for neighbors at runtime, but I was hoping I could find a way to make it work during development.
A solution for any version of Delphi will work.
Any comments as to why this is a bad idea in general will also be appreciated, as I have not 100% convinced myself that this is the right approach. :-)