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

#include <SelectCmd.hh>

Inheritance diagram for SelectCmd:
Inheritance graph
Collaboration diagram for SelectCmd:
Collaboration graph

Public Member Functions

 SelectCmd ()
 
virtual ~SelectCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual SelectCmdcreate () const
 
virtual std::string icon () const
 
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 changing the canvas tool to the SelectTool.

Definition at line 41 of file SelectCmd.hh.

Constructor & Destructor Documentation

◆ SelectCmd()

SelectCmd::SelectCmd ( )

The Constructor.

Definition at line 45 of file SelectCmd.cc.

Referenced by create().

◆ ~SelectCmd()

SelectCmd::~SelectCmd ( )
virtual

The Destructor.

Definition at line 54 of file SelectCmd.cc.

54  {
55 }

Member Function Documentation

◆ create()

SelectCmd * SelectCmd::create ( ) const
virtual

Creates and returns a new instance of this command.

Returns
Newly created instance of this command.

Implements GUICommand.

Definition at line 92 of file SelectCmd.cc.

92  {
93  return new SelectCmd();
94 }

References SelectCmd().

Here is the call graph for this function:

◆ Do()

bool SelectCmd::Do ( )
virtual

Executes the command.

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

Implements GUICommand.

Definition at line 64 of file SelectCmd.cc.

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

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

Here is the call graph for this function:

◆ icon()

string SelectCmd::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 103 of file SelectCmd.cc.

103  {
105 }

References ProDeConstants::CMD_ICON_SELECT.

◆ id()

int SelectCmd::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 81 of file SelectCmd.cc.

81  {
83 }

References ProDeConstants::COMMAND_SELECT.

◆ isEnabled()

bool SelectCmd::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 116 of file SelectCmd.cc.

116  {
117  wxDocManager* manager = wxGetApp().docManager();
118  if (manager->GetCurrentView() != NULL) {
119  return true;
120  }
121  return false;
122 }

The documentation for this class was generated from the following files:
ProDeConstants::CMD_NAME_SELECT
static const std::string CMD_NAME_SELECT
Command name for the "Select" command.
Definition: ProDeConstants.hh:133
SelectTool
Definition: SelectTool.hh:47
MDFView::canvas
MachineCanvas * canvas() const
Definition: MDFView.cc:229
SelectCmd::SelectCmd
SelectCmd()
Definition: SelectCmd.cc:45
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::COMMAND_SELECT
@ COMMAND_SELECT
Definition: ProDeConstants.hh:460
EditorCommand::view
wxView * view() const
Definition: EditorCommand.cc:76
MDFView::clearSelection
void clearSelection()
Definition: MDFView.cc:182
ProDeConstants::CMD_ICON_SELECT
static const std::string CMD_ICON_SELECT
Icon location for the "Select" command.
Definition: ProDeConstants.hh:304
MDFView
Definition: MDFView.hh:59