A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://wxpython.org/Phoenix/docs/html/wx.CommandProcessor.html below:

wx.CommandProcessor — wxPython Phoenix 4.2.4a1 documentation

wx.CommandProcessor¶

wx.CommandProcessor is a class that maintains a history of Commands, with undo/redo functionality built-in.

Derive a new class from this if you want different behaviour.

Class Hierarchy¶

Inheritance diagram for class

CommandProcessor

:

Methods Summary¶

__init__

Constructor.

CanRedo

Returns True if the currently-active command can be redone, False otherwise.

CanUndo

Returns True if the currently-active command can be undone, False otherwise.

ClearCommands

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

GetCommands

Returns the list of commands.

GetCurrentCommand

Returns the current command.

GetEditMenu

Returns the edit menu associated with the command processor.

GetMaxCommands

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

GetRedoAccelerator

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

GetRedoMenuLabel

Returns the string that will be shown for the redo menu item.

GetUndoAccelerator

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

GetUndoMenuLabel

Returns the string that will be shown for the undo menu item.

Initialize

Initializes the command processor, setting the current command to the last in the list (if any), and updating the edit menu (if one has been specified).

IsDirty

Returns a boolean value that indicates if changes have been made since the last save operation.

MarkAsSaved

You must call this method whenever the project is saved if you plan to use IsDirty .

Redo

Executes (redoes) the current command (the command that has just been undone if any).

SetEditMenu

Tells the command processor to update the Undo and Redo items on this menu as appropriate.

SetMenuStrings

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

SetRedoAccelerator

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

SetUndoAccelerator

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

Store

Just store the command without executing it.

Submit

Submits a new command to the command processor.

Undo

Undoes the last command executed.

Properties Summary¶ Class API¶
class wx.CommandProcessor(Object)¶

Possible constructors:

CommandProcessor(maxCommands=-1) -> None

CommandProcessor is a class that maintains a history of Commands, with undo/redo functionality built-in.


Methods¶
__init__(self, maxCommands=-1)¶

Constructor.

Parameters:

maxCommands (int) – 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.

Return type:

None


CanRedo(self)¶

Returns True if the currently-active command can be redone, False otherwise.

Return type:

bool


CanUndo(self)¶

Returns True if the currently-active command can be undone, False otherwise.

Return type:

bool


ClearCommands(self)¶

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

Return type:

None


GetCommands(self)¶

Returns the list of commands.

Return type:

CommandList


GetCurrentCommand(self)¶

Returns the current command.

Return type:

wx.Command


GetEditMenu(self)¶

Returns the edit menu associated with the command processor.

Return type:

wx.Menu


GetMaxCommands(self)¶

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

Return type:

int


GetRedoAccelerator(self)¶

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

Return type:

str


GetRedoMenuLabel(self)¶

Returns the string that will be shown for the redo menu item.

Return type:

str


GetUndoAccelerator(self)¶

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

Return type:

str


GetUndoMenuLabel(self)¶

Returns the string that will be shown for the undo menu item.

Return type:

str


Initialize(self)¶

Initializes the command processor, setting the current command to the last in the list (if any), and updating the edit menu (if one has been specified).

Return type:

None


IsDirty(self)¶

Returns a boolean value that indicates if changes have been made since the last save operation.

This only works if MarkAsSaved is called whenever the project is saved.

Return type:

bool


MarkAsSaved(self)¶

You must call this method whenever the project is saved if you plan to use IsDirty .

Return type:

None


Redo(self)¶

Executes (redoes) the current command (the command that has just been undone if any).

Return type:

bool


SetEditMenu(self, menu)¶

Tells the command processor to update the Undo and Redo items on this menu as appropriate.

Set this to None 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.

Parameters:

menu (wx.Menu)

Return type:

None


SetMenuStrings(self)¶

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

Return type:

None


SetRedoAccelerator(self, accel)¶

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

Parameters:

accel (string)

Return type:

None


SetUndoAccelerator(self, accel)¶

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

Parameters:

accel (string)

Return type:

None


Store(self, command)¶

Just store the command without executing it.

The command is stored in the history list, and the associated edit menu (if any) updated appropriately.

Parameters:

command (wx.Command)

Return type:

None


Submit(self, command, storeIt=True)¶

Submits a new command to the command processor.

The command processor calls wx.Command.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.

Parameters:
  • command (wx.Command) – The command to submit

  • storeIt (bool) – Indicates whether the successful command should be stored in the history list.

Return type:

bool


Undo(self)¶

Undoes the last command executed.

Return type:

bool


Properties¶
Commands¶

See GetCommands


CurrentCommand¶

See GetCurrentCommand


EditMenu¶

See GetEditMenu and SetEditMenu


MaxCommands¶

See GetMaxCommands


RedoAccelerator¶

See GetRedoAccelerator and SetRedoAccelerator


RedoMenuLabel¶

See GetRedoMenuLabel


UndoAccelerator¶

See GetUndoAccelerator and SetUndoAccelerator


UndoMenuLabel¶

See GetUndoMenuLabel


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4