OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RedoCmd Class Reference

#include <RedoCmd.hh>

Inheritance diagram for RedoCmd:
Inheritance graph
Collaboration diagram for RedoCmd:
Collaboration graph

Public Member Functions

 RedoCmd ()
 
virtual ~RedoCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual RedoCmdcreate () const
 
virtual std::string icon () const
 
virtual bool isEnabled ()
 
- Public Member Functions inherited from EditorCommand
 EditorCommand (std::string name, wxWindow *parent=NULL)
 
virtual ~EditorCommand ()
 
void setView (wxView *view)
 
wxView * view () const
 
- Public Member Functions inherited from GUICommand
 GUICommand (std::string name, wxWindow *parent)
 
virtual ~GUICommand ()
 
virtual bool isChecked () const
 
virtual std::string shortName () const
 
void setParentWindow (wxWindow *view)
 
wxWindow * parentWindow () const
 
std::string name () const
 

Detailed Description

EditorCommand for redoing undone modifications to the machine.

Definition at line 41 of file RedoCmd.hh.

Constructor & Destructor Documentation

◆ RedoCmd()

RedoCmd::RedoCmd ( )

The Constructor.

Definition at line 44 of file RedoCmd.cc.

44 :
46
47}
static const std::string CMD_NAME_REDO
Command name for the "Redo" command.

Referenced by create().

◆ ~RedoCmd()

RedoCmd::~RedoCmd ( )
virtual

The Destructor.

Definition at line 53 of file RedoCmd.cc.

53{}

Member Function Documentation

◆ create()

RedoCmd * RedoCmd::create ( ) const
virtual

Creates and returns a new instance of this command.

Returns
Newly created instance of this command.

Implements GUICommand.

Definition at line 85 of file RedoCmd.cc.

85 {
86 return new RedoCmd();
87}
RedoCmd()
Definition RedoCmd.cc:44

References RedoCmd().

Here is the call graph for this function:

◆ Do()

bool RedoCmd::Do ( )
virtual

Executes the command.

Returns
Always false.

Implements GUICommand.

Definition at line 62 of file RedoCmd.cc.

62 {
63 dynamic_cast<MDFDocument*>(view()->GetDocument())->getModel()->redo();
64 return false;
65}
wxView * view() const

References EditorCommand::view().

Here is the call graph for this function:

◆ icon()

string RedoCmd::icon ( ) const
virtual

Returns path to the command's icon file.

Returns
Full path to the command's icon file.

Reimplemented from EditorCommand.

Definition at line 97 of file RedoCmd.cc.

97 {
99}
static const std::string CMD_ICON_REDO
Icon location for the "Redo" command.

References ProDeConstants::CMD_ICON_REDO.

◆ id()

int RedoCmd::id ( ) const
virtual

Returns id of this command.

Returns
ID for this command to be used in menus and toolbars.

Implements GUICommand.

Definition at line 74 of file RedoCmd.cc.

References ProDeConstants::COMMAND_REDO.

◆ isEnabled()

bool RedoCmd::isEnabled ( )
virtual

Returns true when the command is executable, false when not.

This command is executable when the model has an undone modification cached.

Returns
True, if the model's redo cache is not empty.

Reimplemented from EditorCommand.

Definition at line 111 of file RedoCmd.cc.

111 {
112
113 wxDocManager* manager = wxGetApp().docManager();
114
115 wxView* view = manager->GetCurrentView();
116 if (view == NULL) {
117 return false;
118 }
119
120 Model* model =
121 dynamic_cast<MDFDocument*>(view->GetDocument())->getModel();
122
123 if (model != NULL && model->canRedo()) {
124 return true;
125 }
126 return false;
127}
Definition Model.hh:50
bool canRedo()
Definition Model.cc:228

References Model::canRedo(), and EditorCommand::view().

Here is the call graph for this function:

The documentation for this class was generated from the following files: