On Mon, 2 Oct 2006 21:58:14 +0200 (CEST)
Michael Van Canneyt <[EMAIL PROTECTED]> wrote:
>
>
> On Mon, 2 Oct 2006, Mattias Gaertner 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.
>
> You don't need to ? You just need to re-read the changed properties.
>
> Example:
> Form1 - Button 1.
> Form2 - Descendent of Form 1.
>
> On Form2 I change the caption of Button 1.
> I change the location of button 1 on form 1.
> On form2 the location is also changed to match the location of the
> button on form1, but the caption remains changed.
>
> So all you need to do is to:
>
> 1. Stream the parent component (button1 on form1)
Do you mean, after the change of the caption, don't you?
> 2. Apply this stream to the descendent component (button1 on form2).
> 3. Apply the previous inherited stream to the descendent component.
What do you mean with 'previous inherited stream'?
> Or am I missing something ? It's not necessary to stream the whole
> form ?
The problem are the default values.
If you change the Form1.Button1.Caption back to the default value, it
won't be saved to the stream. When this stream is loaded by
Form2.Button1 the Caption remains unchanged.
Or am I missing something?
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives