trichview.com

trichview.support




Grouping Undo problem


Return to index


Author

Message

Glenn

Posted: 12/15/2004 11:24:28


I've set up my TRichViewEdit to make changes to the text as the user is

typing, thing is I want these changes in the same undo-group as whatever

the user action that caused them is in.



I've tried:


   in the OnChanging event handler:

     RichViewEdit.BeginUndoCustomGroup('whatever');

     RichViewEdit.SetUndoGroupMode(True);


   in the OnChange event handler:

     <make my changes to the text>

     RichViewEdit.SetUndoGroupMode(false);



I've even tried:


   in the OnChange event handler:

     RichViewEdit.Undo;

     RichViewEdit.BeginUndoCustomGroup('whatever');

     RichViewEdit.SetUndoGroupMode(True);

     RichViewEdit.Redo;

     <make my changes to the text>

     RichViewEdit.SetUndoGroupMode(false);


And while this sort of thing works for cutting and pasting and most

other operations, if I try to undo actual typing I get "Incorrect adding

into undo list".


I've stepped through my code with the debugger and I'm fairly sure I'm

not mismatching the two calls to SetUndoGroupMode().


More details on what I'm trying to do incase you need them:

When the user finishes typing a certain word, my code picks up on this

(via the OnChange event) and changes the colour and style of that word

(this can result in items merging or new items being created). I want

the undo to undo that colour and style change as it undoes the user's

typing.



Any ideas? I've read all the relevent support newsgroup posts and I'm

still stumped as to why it doesn't work.


thanks.





Powered by ABC Amber Outlook Express Converter