>> Please can anyone suggest some helpful reading or explain good
>> techniques by which to provide good 'Undo' in ones application.
>The one that has taxed me for a while is how to implement a OK / Cancel
>function on a configuration diagram. One needs some sort of scripting in
>order to undo all the changes made in a dialog if the user decides to
>cancel.
If your configuration model is an object derived from Tpersistent with full
assign functionality then you can duplicate the configuration at entry.
Allow
editing to the copy and implement OK, APPLY, CANCEL and UNDO as
OK := APPLY and CANCEL;
APPLY := Original.Assign(Copy);
CANCEL := closedialog;
UNDO := Copy.Assign(Original);
If your derivative also implements a modified flag (with begin, end update)
you
can drive the modality of the OK,APPLY,CANCEL,UNDO from events triggered
in the object.
--
Aaron@home
---------------------------------------------------------------------------
New Zealand Delphi Users group - Offtopic List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz