On Tue, 18 Sep 2007 23:01:24 +0200
"Graeme Geldenhuys" <[EMAIL PROTECTED]> wrote:

> On 18/09/2007, Michael Van Canneyt <[EMAIL PROTECTED]> wrote:
> > > >   * How does it track changes made to components implemented in
> > > > the parent class?
> > >
> > > It does not yet. I already have some experimental code for this,
> > > but it needs completion and integration into the IDE. The MSEGUI
> > > seems to use its property hooks and always streams the complete
> > > form, which works good for small forms and normal property
> > > editors.
> >
> > ? How can this work ?
> >
> 
> I'm also a bit lost... :)  Then again, I haven't had a look at the
> MSEGUI code yet.

I didn't look at the code in detail and I tested in some months ago, so
maybe it works different nowadays:
To recognize changes, you can either use hooks (i.e. OnChange events)
or check regularly all properties for changes. This includes the custom
properties (DefineProperties), which can only be read/written by
TReader/TWriter. A big problem is to get the default values.
The easiest way (and the slowest) is to simply use TWriter to read all
values. (TWriter is slow, because it uses a lot of linear searches).
And the easiest way (and the slowest) to apply the changes to a
descendant is to recreate it (TReader uses lots of linear searches
too). This way you get the correct default values and read the ancestor
streams in the right order.
Of course you must make sure, that before any ancestor is changed, all
descendants are written first (in memory). This can be easily done by
writing everytime a form changed.
AFAIK MSEGUI is clever enough to enable this mechanism only when there
are an ancestor and a descendant open at the same time.


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to