Undo in Tables

General TRichView support forum. Please post your questions here
Post Reply
standay
Posts: 274
Joined: Fri Jun 18, 2021 3:07 pm

Undo in Tables

Post by standay »

Hi Sergey,

I notice when I type into a table and try to undo, it does nothing. If I click outside the table and undo, it works. Is this the expected behavior? I'd like for the table to undo while I'm still inside the table. I tried this in my rve KeyUp:

Code: Select all

procedure TForm1.rveKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if rve.InplaceEditor <> nil then
  begin
    if (Key = ord('Z')) and (Shift = [ssCtrl]) then
      rve.Undo;
  end;
...
This gives me the expected (by me anyway!) behavior. Can you tell me if this is correct?

Thanks Sergey

Stan
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Undo in Tables

Post by Sergey Tkachenko »

I cannot reproduce this problem.
I tried both in RichViewActions' ActionTest (where Ctrl+Z is handled by TrvActionUndo) and in a fresh project (just placed TRichViewEdit, TRVStyle, linked them, ran, pasted a table from MS Word).
Maybe you have some events assigned that prevent processing undo?
standay
Posts: 274
Joined: Fri Jun 18, 2021 3:07 pm

Re: Undo in Tables

Post by standay »

Hi Sergey,

I was working on some other stuff this morning and fixed a problem with that which also fixed this issue. It was some code dealing with my RVRuler in appIdle.

So, yes, something I did caused it but it's good to have confirmation of how it should work!

Thanks again Sergey, really appreciate your help.

Stan
Post Reply