Page 1 of 1

OnChange Issue

Posted: Mon Feb 09, 2009 9:46 pm
by DavidRM
I'm having a situation where an empty SRVE is triggering the internal TRVE's OnChange event when it's doing an initial repaint. I repeat: It's an empty SRVE. Nothing has been loaded. But the initial repaint event sets the internal TRVE's pageheight or something like that and suddenly we have an OnChange event.

That makes it very hard to accurately track whether there as *really* been any changes or not.

And if you could also make it so that calling SRVE's Format procedure doesn't trigger an OnChange event, I'd be ecstatic.

Thanks.

-David

Posted: Tue Feb 10, 2009 10:44 am
by proxy3d
How to me to reproduce call OnChange for empty SRV? If I put on form SRV and I start the application at me call OnChange does not occur. If in ActionTest I press to create the new document creates OnChange (the document changes, therefore it is caused).
Make changes to a code:

Code: Select all

procedure TSRichViewEdit.HookOnChange(Sender: TObject);
.....
  if FCanRefreshData then begin
    if Assigned(FStoredOnChange) then
      FStoredOnChange(Sender);

    if Assigned(FOnChange) then
      FOnChange(Self);
  end;

Posted: Tue Feb 10, 2009 6:47 pm
by DavidRM
I'll try to narrow things down more today.

Thanks for the code fix.

-David