On Thu, 05 Oct 2006 11:50:03 +0200 Marc Weustink <[EMAIL PROTECTED]> wrote:
> Mattias Gaertner wrote: > > On Thu, 05 Oct 2006 10:45:25 +0200 > > Marc Weustink <[EMAIL PROTECTED]> wrote: > > > >> [...] > >>>>>> Modified needs to be modified :) > >>>>>> > >>>>>> procedure Modified; > >>>>>> begin > >>>>>> SendBeginModificationToAllBeginEndObeservers; > >>>>>> SendModifiedNotificationToAllModifiedObeservers; > >>>>>> SendEndModificationToAllBeginEndObeservers; > >>>>>> end; > >>>>> But then Begin/End is useless, isn't it? The modification took > >>>>> place before 'Begin'. For example: > >>>>> > >>>>> NewToolButton.Parent:=CurToolBar; > >>>>> Modified; > >>>> Indeed, I was more thinking of controls reacting on the > >>>> ModifiedNotification which would trigger more modifications. > >>>> > >>>> In your example, an editor sets the Parent and calls Modified. > >>>> Why would setting the parent trigger other code which will call > >>>> Modified ? Afterall, Modified is a Designer/Editor method, and > >>>> should/can not be called from the component itself. So I see no > >>>> chain of modified there. > >>> There are some components, that call Modified. For example > >>> changing the PageIndex of a TNoteBook. But this is very rare and > >>> can be changed. Let's ignore these things. > >>> > >>> More important is that we don't have a working Begin/End > >>> enclosement. So, we can only react, but not prepare. Or in other > >>> words: Only a OnModified event, but no OnChanging. > >>> > >>> At the moment the solution is to swallow the bitter pill and > >>> implement a dynamic property propagation system. The more > >>> information the changer (e.g. OI) provides, the less the system > >>> will copy. The OI can call BeginUpdate/ChangeProperty/EndUpdate, > >>> while others can call Modified and the whole forms are > >>> scanned/copied. > >> Whats wrong with adapting modified ? > >> > >> That is the difference of having one OnModified, or having > >> observers which subscribe themselves to begen/end notifications > > > > Begin/EndUpdate and notifications are a good idea and needed. > > > > I'm just unhappy, that there is no more elegant solution for copying > > the data to the descendants. > > It may be the case, but, what would a elegant way help if it isn't > used that often. > I mean, you need this to be able to efficiently update descendant > forms. How often will one edit ancestor while descendants are open. > So question is, is the efford needed Don't forget: The default is to open the form when opening the unit. I disabled this 'feature' and I guess you too. And I know many users, who keep many units open. That's why I think, when people edit an ancestor at least one descendant will be open. Mattias _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives