Undo support PWStyleHTMLField offers integrated Undo/Redo support. You can turn it off if you like by providing a value of 0 for the kUndoTypingInterval constant. The constant is included in the PWUndoConstants module in the demo project. You can also adjust the number of Undos and Redos that are remembered by changing the kMaxUndos value. If you include support for Undo/Redo, you must have EditUndo and EditRedo menu items in your menu bar in order to compile the project. PWStyleHTMLField records the current state in its KeyDown handler every n seconds, based on the kUndoTypingInterval value (unless it is preempted by another event), and with any state change that it makes through its SetStyle or new SetPlain functions. If you make a style or font change directly via one of the EditField/TextArea class methods, you'll need to use the PWStyleHTMLField class's new SetModified method to register the changed state with the Undo system. You can see examples of this in the mainWin.SetFont and .SetSize methods in the main window of the demo project. See documentation for the PWStyleHTMLField.SetModified method for more information. |