X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae3c17b4013e80b99976c750c19fca47729517f6..95b4a59e67af301bb6ff061055ac5a9a09b96d6c:/interface/wx/cmdproc.h diff --git a/interface/wx/cmdproc.h b/interface/wx/cmdproc.h index a0bd1d0a2f..1698d9e7b7 100644 --- a/interface/wx/cmdproc.h +++ b/interface/wx/cmdproc.h @@ -8,7 +8,6 @@ /** @class wxCommand - @wxheader{cmdproc.h} wxCommand is a base class for modelling an application command, which is an action usually performed by selecting a menu item, pressing a toolbar @@ -36,17 +35,17 @@ public: Must be supplied for the command processor to display the command name in the application's edit menu. */ - wxCommand(bool canUndo = false, const wxString& name = NULL); + wxCommand(bool canUndo = false, const wxString& name = wxEmptyString); /** Destructor. */ - ~wxCommand(); + virtual ~wxCommand(); /** Returns @true if the command can be undone, @false otherwise. */ - bool CanUndo(); + virtual bool CanUndo() const; /** Override this member function to execute the appropriate action when @@ -57,19 +56,19 @@ public: processor that the action is not undoable and should not be added to the command history. */ - bool Do(); + virtual bool Do(); /** Returns the command name. */ - wxString GetName(); + virtual wxString GetName() const; /** Override this member function to un-execute a previous Do. How you implement this command is totally application dependent, but typical strategies include: - + - Perform an inverse operation on the last modified piece of data in the document. When redone, a copy of data stored in command is pasted back or some operation reapplied. This relies on the fact that you @@ -86,14 +85,13 @@ public: processor that the action is not redoable and no change should be made to the command history. */ - bool Undo(); + virtual bool Undo(); }; /** @class wxCommandProcessor - @wxheader{cmdproc.h} 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 @@ -120,13 +118,13 @@ public: /** Destructor. */ - ~wxCommandProcessor(); + virtual ~wxCommandProcessor(); /** Returns @true if the currently-active command can be undone, @false otherwise. */ - virtual bool CanUndo(); + virtual bool CanUndo() const; /** Deletes all commands in the list and sets the current command pointer @@ -137,7 +135,7 @@ public: /** Returns the list of commands. */ - wxList& GetCommands() const; + wxList& GetCommands(); /** Returns the edit menu associated with the command processor. @@ -182,13 +180,13 @@ public: the last save operation. This only works if MarkAsSaved() is called whenever the project is saved. */ - virtual bool IsDirty(); + virtual bool IsDirty() const; /** You must call this method whenever the project is saved if you plan to use IsDirty(). */ - virtual void MarkAsSaved(); + void MarkAsSaved(); /** Executes (redoes) the current command (the command that has just been @@ -208,7 +206,7 @@ public: Sets the menu labels according to the currently set menu and the current command state. */ - void SetMenuStrings(); + virtual void SetMenuStrings(); /** Sets the string that will be appended to the Redo menu item.