Page 1 of 1

Undo type selection

Posted: Tue Jun 17, 2008 1:06 am
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?

Posted: Tue Jun 17, 2008 5:05 am
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?

Posted: Tue Jun 17, 2008 5:07 am
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\