OpenASIP  2.0
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 }

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 }

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 }

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 }

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.

74  {
76 }

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 }

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:
EditorCommand::EditorCommand
EditorCommand(std::string name, wxWindow *parent=NULL)
Definition: EditorCommand.cc:42
EditorCommand::view
wxView * view() const
Definition: EditorCommand.cc:76
Model::canRedo
bool canRedo()
Definition: Model.cc:228
ProDeConstants::COMMAND_REDO
@ COMMAND_REDO
Definition: ProDeConstants.hh:434
RedoCmd::RedoCmd
RedoCmd()
Definition: RedoCmd.cc:44
MDFDocument
Definition: MDFDocument.hh:51
Model
Definition: Model.hh:50
ProDeConstants::CMD_ICON_REDO
static const std::string CMD_ICON_REDO
Icon location for the "Redo" command.
Definition: ProDeConstants.hh:308
ProDeConstants::CMD_NAME_REDO
static const std::string CMD_NAME_REDO
Command name for the "Redo" command.
Definition: ProDeConstants.hh:124