Class TUndoRedo (unit cUndoRedo)

Inherits from

TComponent

-------------------------------------------------------

Constructors


constructor Create(AOwner: TComponent);

-------------------------------------------------------} {---------- Beginning of TUndoRedo ---------------------} {-------------------------------------------------------} {-------------------------------------------------------


Functions

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;

-------------------------------------------------------

Properties

property RedoCount : Integer


property UndoCount : Integer


Events

event OnClear : TNotifyEvent


event OnCreateAction : TCreateEvent


event OnDoAction : TNotifyEvent


event OnRedoAction : TNotifyEvent


event OnUndoAction : TNotifyEvent


Variables

FOnAction : TNotifyEvent;


FOnClear : TNotifyEvent;


FOnCreateAction : TCreateEvent;


FOnRedoAction : TNotifyEvent;


FOnUndoAction : TNotifyEvent;


RedoStack : TStack;


UndoStack : TStack;



Constructors


constructor Create(AOwner: TComponent);

-------------------------------------------------------} {---------- Beginning of TUndoRedo ---------------------} {-------------------------------------------------------} {-------------------------------------------------------


Functions


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;

-------------------------------------------------------


Properties


property RedoCount : Integer


property UndoCount : Integer


Events


event OnClear : TNotifyEvent


event OnCreateAction : TCreateEvent


event OnDoAction : TNotifyEvent


event OnRedoAction : TNotifyEvent


event OnUndoAction : TNotifyEvent


Variables


FOnAction : TNotifyEvent;


FOnClear : TNotifyEvent;


FOnCreateAction : TCreateEvent;


FOnRedoAction : TNotifyEvent;


FOnUndoAction : TNotifyEvent;


RedoStack : TStack;


UndoStack : TStack;