Undo after save. How to ?

General TRichView support forum. Please post your questions here
Post Reply
Marsianin
Posts: 193
Joined: Sun Sep 25, 2005 11:03 pm

Undo after save. How to ?

Post by Marsianin »

Have program with TRichView.
On some events program saves (to stream) text automatically but I'm loosing undo after that.
How to prevent it ? Want undo after save.
Sergey Tkachenko
Site Admin
Posts: 17522
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Undo becomes disabled if you call DeleteUnusedStyles or ClearUndo methods (what's why RichViewActions call DeleteUnusedStyles after loading/creating a document, not on saving)
Marsianin
Posts: 193
Joined: Sun Sep 25, 2005 11:03 pm

Post by Marsianin »

My program saves data when main window became inactive and using DeleteUnusedStyles (RVActions used too).
And when I came back to program undo became disabled :?
Sergey Tkachenko
Site Admin
Posts: 17522
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Unfortunately, it's unavoidable in the current version, if you use DeleteUnusedStyles. This method deletes all styles which do not present in the document, but some deleted fragment in undo buffer may require them. What's why the undo buffer is cleared.
Post Reply