Graeme Geldenhuys wrote: > To add to that, I suggested to Mattias using something like the > Observer pattern, but I find it difficult to see how we could trigger > the Notify event of the Subject (ancestor form), with so many places > that the ancestor form can be modified form. So this might not be a > solution, just though I would mention it anyway. Maybe it sparks some > other ideas. ;-)
The observer pattern will work here. Every descendant "subscribes" itself to a change notification. IIRC, the ancestor knows when something is changed (you need this enyway to reflect changes in the desinger). So when changes the ancestor notifies its observers, which reload them selves. That the ancestor can be edited in severla ways, doesn't matter in this case. Marc > Regards, > - Graeme - > > > On 02/10/06, Mattias Gaertner <[EMAIL PROTECTED]> wrote: >> Hi all, >> >> I want to implement visual form inheritance, but there is one problem, >> for which I don't see a good solution. >> >> The situation: Both the ancestor and descendant forms are open in the >> IDE. >> The Problem: When the ancestor is edited, then the descendants need >> to be updated. >> >> The ancestor can be edited by: >> Object Inspector: Here we can add detailed notifications if needed. >> Designer: the same. >> Anchor Editor: the same. >> Some more tools: the same. >> Component Editors: These can alter the component in various ways. They >> only notify by an unspecific Modified event. >> Experts: Same as Component Editors. >> >> Descendants are loaded by applying first the ancestor values (.lfm) and >> then the descendant overrides. >> >> You can not clear/reset a component. You can only destroy it and create >> it again. >> >> To save the descendant values you need an ancestor instance to find the >> differences/overrides and write them to the .lfm. >> >> And last but not least: >> Saving/Loading a component can take long, if it contains special data >> like images and lists. >> >> >> Mattias >> >> _________________________________________________________________ >> To unsubscribe: mail [EMAIL PROTECTED] with >> "unsubscribe" as the Subject >> archives at http://www.lazarus.freepascal.org/mailarchives >> > > _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
