Page 1 of 1

TRichViewEdit Redo/Undo and OnChanging event

Posted: Wed Jun 08, 2016 10:42 am
by cjb
Hi,

I've been using TRichViewEdit and noticed a possible inconsistency with how the OnChanging event is not triggered before Redo/Undo operations. I noticed this when tracking down some inconsistent behaviour in my app. It seems to me that the event should be triggered.

So would it be sensible to change the code implementation as follows?

Code: Select all

procedure TCustomRichViewEdit.Redo;
begin
...
    DoChanging; 	// Add this call here?
    TRVEditRVData(RVData).RedoList.Redo(RVData);
    DoChange(False);
  end
  else
    RVData.Beep;
end;

procedure TCustomRichViewEdit.Undo;
begin
...
    DoChanging; 	// Add this call here?
    TRVEditRVData(RVData).UndoList.Undo(RVData);
    DoChange(False);
  end
  else
    RVData.Beep;
end;
I look forward to your thoughts - thanks.

Posted: Mon Jun 13, 2016 1:10 pm
by cjb
Any thoughts on this please as I would like to avoid having to make local changes to the TRichViewEdit source code if possible...

Thanks!

Posted: Mon Jun 13, 2016 1:21 pm
by Sergey Tkachenko
I need to think about it, but it looks like this change is correct, and should be included in the components.

Posted: Sun Jul 03, 2016 9:21 am
by Sergey Tkachenko
Included in TRichView 16.7.2 (available for registered users)

Posted: Thu Jul 14, 2016 2:18 pm
by cjb
Many thanks much appreciated!