Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

CommandHistory Class Reference

Collaboration diagram for CommandHistory:

Collaboration graph
[legend]
List of all members.

Detailed Description

CommandHistory - implements generic undo-functionality (used for editing Parse-Trees, see class ParseTree and VisParses)

Author:
Dietmar Dreyer
$Id commandhistory.tcl $

Definition at line 21 of file commandhistory.tcl.

Public Member Functions

 add (TclList command, TclList commandInverse)
 addListener (TclString listener)
 canRedo ()
 canUndo ()
 redo ()
 undo ()

Protected Member Functions

 update ()

Private Attributes

TclRef _commandList = ""
TclRef _cursor = -1
TclRef _inverseCommandList = ""
TclRef _listenerList = ""


Member Function Documentation

CommandHistory::addListener TclString  listener  ) 
 

Registers listener object which will be called whenever a change to the command list happens

Parameters:
listener Object-ID implementing method update
Definition at line 101 of file commandhistory.tcl.

CommandHistory::canRedo  ) 
 

Similar to canUndo

Returns:
1 => redo possible, 0 => no redo possible
Definition at line 157 of file commandhistory.tcl.

CommandHistory::canUndo  ) 
 

Predicate to determine if calling undo will take effect

Returns:
1 => undo will take effect, 0 => not possible
Definition at line 142 of file commandhistory.tcl.

CommandHistory::redo  ) 
 

Calls current redo command and let cursor point to next command in the list (move to end) Definition at line 128 of file commandhistory.tcl.

CommandHistory::undo  ) 
 

Calls current undo command and modifies internal cursor to point to previous command in the list (move to beginning) Definition at line 113 of file commandhistory.tcl.

update CommandHistory::update  )  [protected]
 

Internal method used to update registered listeners whenever a change to the list of commands occurred Definition at line 88 of file commandhistory.tcl.


Member Data Documentation

TclRef CommandHistory::_commandList = "" [private]
 

list of commands used for redoing actions

Definition at line 30 of file commandhistory.tcl.

TclRef CommandHistory::_cursor = -1 [private]
 

current position in command lists

Definition at line 27 of file commandhistory.tcl.

TclRef CommandHistory::_inverseCommandList = "" [private]
 

list of commands used for undoing actions

Definition at line 33 of file commandhistory.tcl.

TclRef CommandHistory::_listenerList = "" [private]
 

list of object-IDs recognizing update-method

Definition at line 36 of file commandhistory.tcl.


The documentation for this class was generated from the following file:
XCDG 0.95 (20 Oct 2004)