OpenASIP  2.0
Public Member Functions | List of all members
EditConnectionsCmd Class Reference

#include <EditConnectionsCmd.hh>

Inheritance diagram for EditConnectionsCmd:
Inheritance graph
Collaboration diagram for EditConnectionsCmd:
Collaboration graph

Public Member Functions

 EditConnectionsCmd ()
 
virtual ~EditConnectionsCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual EditConnectionsCmdcreate () const
 
virtual std::string icon () const
 
virtual std::string shortName () 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
 
void setParentWindow (wxWindow *view)
 
wxWindow * parentWindow () const
 
std::string name () const
 

Detailed Description

wxCommand for editing connections.

Definition at line 42 of file EditConnectionsCmd.hh.

Constructor & Destructor Documentation

◆ EditConnectionsCmd()

EditConnectionsCmd::EditConnectionsCmd ( )

The Constructor.

Definition at line 47 of file EditConnectionsCmd.cc.

Referenced by create().

◆ ~EditConnectionsCmd()

EditConnectionsCmd::~EditConnectionsCmd ( )
virtual

The Destructor.

Definition at line 56 of file EditConnectionsCmd.cc.

56 {}

Member Function Documentation

◆ create()

EditConnectionsCmd * EditConnectionsCmd::create ( ) const
virtual

Creates and returns a new instance of this command.

Implements GUICommand.

Definition at line 89 of file EditConnectionsCmd.cc.

89  {
90  return new EditConnectionsCmd();
91 }

References EditConnectionsCmd().

Here is the call graph for this function:

◆ Do()

bool EditConnectionsCmd::Do ( )
virtual

Executes the command.

Returns
True, if the command was succesfully executed, false otherwise.

Implements GUICommand.

Definition at line 65 of file EditConnectionsCmd.cc.

65  {
66  MDFView* mdfView = dynamic_cast<MDFView*>(view());
67  ChildFrame* frame = dynamic_cast<ChildFrame*>(mdfView->GetFrame());
68  assert(frame != NULL);
69  mdfView->clearSelection();
70  ConnectTool* tool = new ConnectTool(frame, mdfView);
71  mdfView->canvas()->setTool(tool);
72  return true;
73 }

References assert, MDFView::canvas(), MDFView::clearSelection(), MachineCanvas::setTool(), and EditorCommand::view().

Here is the call graph for this function:

◆ icon()

string EditConnectionsCmd::icon ( ) const
virtual

Returns path to the command's icon file.

Reimplemented from EditorCommand.

Definition at line 98 of file EditConnectionsCmd.cc.

98  {
100 }

References ProDeConstants::CMD_ICON_EDIT_CONNECTIONS.

◆ id()

int EditConnectionsCmd::id ( ) const
virtual

Returns id of this command.

Implements GUICommand.

Definition at line 80 of file EditConnectionsCmd.cc.

80  {
82 }

References ProDeConstants::COMMAND_EDIT_CONNECTIONS.

◆ isEnabled()

bool EditConnectionsCmd::isEnabled ( )
virtual

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

This command is executable when a document is open.

Returns
True, if a document is open.

Reimplemented from EditorCommand.

Definition at line 120 of file EditConnectionsCmd.cc.

120  {
121  wxDocManager* manager = wxGetApp().docManager();
122  if (manager->GetCurrentView() != NULL) {
123  return true;
124  }
125  return false;
126 }

◆ shortName()

string EditConnectionsCmd::shortName ( ) const
virtual

Returns short version of the command name.

Reimplemented from GUICommand.

Definition at line 107 of file EditConnectionsCmd.cc.

107  {
109 }

References ProDeConstants::CMD_SNAME_EDIT_CONNECTIONS.


The documentation for this class was generated from the following files:
ProDeConstants::COMMAND_EDIT_CONNECTIONS
@ COMMAND_EDIT_CONNECTIONS
Definition: ProDeConstants.hh:439
MDFView::canvas
MachineCanvas * canvas() const
Definition: MDFView.cc:229
ProDeConstants::CMD_ICON_EDIT_CONNECTIONS
static const std::string CMD_ICON_EDIT_CONNECTIONS
Icon location for the "Edit Connections" command.
Definition: ProDeConstants.hh:344
ChildFrame
Definition: ChildFrame.hh:42
EditorCommand::EditorCommand
EditorCommand(std::string name, wxWindow *parent=NULL)
Definition: EditorCommand.cc:42
MachineCanvas::setTool
void setTool(MachineCanvasTool *tool)
Definition: MachineCanvas.cc:305
assert
#define assert(condition)
Definition: Application.hh:86
ProDeConstants::CMD_NAME_EDIT_CONNECTIONS
static const std::string CMD_NAME_EDIT_CONNECTIONS
Command name for the "Edit Connections" command.
Definition: ProDeConstants.hh:135
EditConnectionsCmd::EditConnectionsCmd
EditConnectionsCmd()
Definition: EditConnectionsCmd.cc:47
EditorCommand::view
wxView * view() const
Definition: EditorCommand.cc:76
MDFView::clearSelection
void clearSelection()
Definition: MDFView.cc:182
ConnectTool
Definition: ConnectTool.hh:47
ProDeConstants::CMD_SNAME_EDIT_CONNECTIONS
static const std::string CMD_SNAME_EDIT_CONNECTIONS
Command name for the "Edit Connections" command.
Definition: ProDeConstants.hh:241
MDFView
Definition: MDFView.hh:59