Undo type selection

General TRichView support forum. Please post your questions here
Post Reply
cychia
Posts: 104
Joined: Mon Jan 16, 2006 1:52 am

Undo type selection

Post by cychia »

If I were to start an undo group with the following calls, which undo type should I should?

RVE.InsertPicture
RVE.SetItemExtraIntProperty(height)
RVE.SetItemExtraIntProperty(width)
RVE.InsertStringTag
RVE.SetCurrentItemExtraStrProperty(Alt);


Is rvutCustom type that I should be using?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Code: Select all

RVE.TopLevelEditor.BeginUndoGroup(rvutInsert);
RVE.TopLevelEditor.SetUndoGroupMode(True);
try
  if RVE.InsertPicture(...) then begin
    RVE.SetCurrentItemExtraIntProperty(rvepImageHeight, ...);
    RVE.SetCurrentItemExtraIntProperty(rvepImageWidth, ...);
    RVE.SetCurrentItemExtraStrProperty(rvespAlt, ...); 
  end;
finally
  RVE.TopLevelEditor.SetUndoGroupMode(False);
end;
I am not sure what you want with InsertStringTag. Do you want to insert image together with text string?
Last edited by Sergey Tkachenko on Tue Jun 17, 2008 5:08 am, edited 1 time in total.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Actually, undo type (specified in BeginUndoGroup) is not used by TRichView itself. It can be read by UndoAction/RedoAction methods, and you can display its caption in undo/redo menu, like the demo Demos\Delphi\Editors\Editor 1\
Post Reply