Class TUndoRedo (unit cUndoRedo) |
Inherits from
TComponent
-------------------------------------------------------
constructor Create(AOwner: TComponent);
- -------------------------------------------------------} {---------- Beginning of TUndoRedo ---------------------} {-------------------------------------------------------} {-------------------------------------------------------
procedure Clear;
-------------------------------------------------------
destructor Destroy;
-------------------------------------------------------
procedure DoAction(Actor: TObject; Action: LongInt);
-------------------------------------------------------} (*
The OnAction Event Handler would look like this in it :
case Value of
UDO_MOVEWINDOW: Worker := TUndoRedoMoveWindow.
function RedoAction: TObject;
-------------------------------------------------------
function UndoAction: TObject;
-------------------------------------------------------
function GetRedoCount: Integer;
-------------------------------------------------------
function GetUndoCount: Integer;
-------------------------------------------------------
property RedoCount : Integer
property UndoCount : Integer
event OnClear : TNotifyEvent
event OnCreateAction : TCreateEvent
event OnDoAction : TNotifyEvent
event OnRedoAction : TNotifyEvent
event OnUndoAction : TNotifyEvent
FOnAction : TNotifyEvent;
FOnClear : TNotifyEvent;
FOnCreateAction : TCreateEvent;
FOnRedoAction : TNotifyEvent;
FOnUndoAction : TNotifyEvent;
RedoStack : TStack;
UndoStack : TStack;
constructor Create(AOwner: TComponent);
-------------------------------------------------------} {---------- Beginning of TUndoRedo ---------------------} {-------------------------------------------------------} {-------------------------------------------------------
procedure Clear;
-------------------------------------------------------
destructor Destroy;
-------------------------------------------------------
procedure DoAction(Actor: TObject; Action: LongInt);
-------------------------------------------------------} (*
The OnAction Event Handler would look like this in it :
case Value of
UDO_MOVEWINDOW: Worker := TUndoRedoMoveWindow.Create;
...
else Worker := nil;
end;
This method is called BEFORE the action is generated.
This method MUST be called for ALL user actions.
If the action cannot be undone then call Clear
to erase all pending undo's and redo's.
Not doing so may result in instability.
function RedoAction: TObject;
-------------------------------------------------------
function UndoAction: TObject;
-------------------------------------------------------
function GetRedoCount: Integer;
-------------------------------------------------------
function GetUndoCount: Integer;
-------------------------------------------------------
property RedoCount : Integer
property UndoCount : Integer
event OnClear : TNotifyEvent
event OnCreateAction : TCreateEvent
event OnDoAction : TNotifyEvent
event OnRedoAction : TNotifyEvent
event OnUndoAction : TNotifyEvent
FOnAction : TNotifyEvent;
FOnClear : TNotifyEvent;
FOnCreateAction : TCreateEvent;
FOnRedoAction : TNotifyEvent;
FOnUndoAction : TNotifyEvent;
RedoStack : TStack;
UndoStack : TStack;