Package wx :: Package lib :: Module docview :: Class CommandProcessor
[frames | no frames]

Type CommandProcessor

object --+    
         |    
    Object --+
             |
            CommandProcessor


wxCommandProcessor is a class that maintains a history of wxCommands, with undo/redo functionality built-in. Derive a new class from this if you want different behaviour.


Method Summary
  __init__(self, maxCommands)
Constructor.
  CanRedo(self)
Returns true if the currently-active command can be redone, false otherwise.
  CanUndo(self)
Returns true if the currently-active command can be undone, false otherwise.
  ClearCommands(self)
Deletes all the commands in the list and sets the current command pointer to None.
  GetCommands(self)
Returns the list of commands.
  GetEditMenu(self)
Returns the edit menu associated with the command processor.
  GetMaxCommands(self)
Returns the maximum number of commands that the command processor stores.
  GetRedoAccelerator(self)
Returns the string that will be appended to the Redo menu item.
  GetUndoAccelerator(self)
Returns the string that will be appended to the Undo menu item.
  Redo(self)
Redoes the command just undone.
  SetEditMenu(self, menu)
Tells the command processor to update the Undo and Redo items on this menu as appropriate.
  SetMenuStrings(self)
Sets the menu labels according to the currently set menu and the current command state.
  SetRedoAccelerator(self, accel)
Sets the string that will be appended to the Redo menu item.
  SetUndoAccelerator(self, accel)
Sets the string that will be appended to the Redo menu item.
  Submit(self, command, storeIt)
Submits a new command to the command processor.
  Undo(self)
Undoes the command just executed.

Property Summary

Method Details

__init__(self, maxCommands=-1)
(Constructor)

Constructor. maxCommands may be set to a positive integer to limit the number of commands stored to it, otherwise (and by default) the list of commands can grow arbitrarily.

Overrides:
wx.Object.__init__

CanRedo(self)

Returns true if the currently-active command can be redone, false otherwise.

CanUndo(self)

Returns true if the currently-active command can be undone, false otherwise.

ClearCommands(self)

Deletes all the commands in the list and sets the current command pointer to None.

GetCommands(self)

Returns the list of commands.

GetEditMenu(self)

Returns the edit menu associated with the command processor.

GetMaxCommands(self)

Returns the maximum number of commands that the command processor stores.

GetRedoAccelerator(self)

Returns the string that will be appended to the Redo menu item.

GetUndoAccelerator(self)

Returns the string that will be appended to the Undo menu item.

Redo(self)

Redoes the command just undone.

SetEditMenu(self, menu)

Tells the command processor to update the Undo and Redo items on this menu as appropriate. Set this to NULL if the menu is about to be destroyed and command operations may still be performed, or the command processor may try to access an invalid pointer.

SetMenuStrings(self)

Sets the menu labels according to the currently set menu and the current command state.

SetRedoAccelerator(self, accel)

Sets the string that will be appended to the Redo menu item.

SetUndoAccelerator(self, accel)

Sets the string that will be appended to the Redo menu item.

Submit(self, command, storeIt=True)

Submits a new command to the command processor. The command processor calls wxCommand::Do to execute the command; if it succeeds, the command is stored in the history list, and the associated edit menu (if any) updated appropriately. If it fails, the command is deleted immediately. Once Submit has been called, the passed command should not be deleted directly by the application.

storeIt indicates whether the successful command should be stored in the history list.

Undo(self)

Undoes the command just executed.


Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:54:33 2009 http://epydoc.sf.net