TRichViewEdit Redo/Undo and OnChanging event

General TRichView support forum. Please post your questions here
Post Reply
cjb
Posts: 12
Joined: Wed Jun 08, 2016 8:47 am

TRichViewEdit Redo/Undo and OnChanging event

Post 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.
cjb
Posts: 12
Joined: Wed Jun 08, 2016 8:47 am

Post 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!
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I need to think about it, but it looks like this change is correct, and should be included in the components.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Included in TRichView 16.7.2 (available for registered users)
cjb
Posts: 12
Joined: Wed Jun 08, 2016 8:47 am

Post by cjb »

Many thanks much appreciated!
Post Reply