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

#include <AddIUFromHDBCmd.hh>

Inheritance diagram for AddIUFromHDBCmd:
Inheritance graph
Collaboration diagram for AddIUFromHDBCmd:
Collaboration graph

Public Member Functions

 AddIUFromHDBCmd ()
 
virtual ~AddIUFromHDBCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual AddIUFromHDBCmdcreate () 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 opening a dialog for adding immediate units from a HDB.

Definition at line 41 of file AddIUFromHDBCmd.hh.

Constructor & Destructor Documentation

◆ AddIUFromHDBCmd()

AddIUFromHDBCmd::AddIUFromHDBCmd ( )

The Constructor.

Definition at line 48 of file AddIUFromHDBCmd.cc.

Referenced by create().

◆ ~AddIUFromHDBCmd()

AddIUFromHDBCmd::~AddIUFromHDBCmd ( )
virtual

The Destructor.

Definition at line 56 of file AddIUFromHDBCmd.cc.

56 {}

Member Function Documentation

◆ create()

AddIUFromHDBCmd * AddIUFromHDBCmd::create ( ) const
virtual

Creates and returns a new instance of this command.

Implements GUICommand.

Definition at line 94 of file AddIUFromHDBCmd.cc.

94  {
95  return new AddIUFromHDBCmd();
96 }

References AddIUFromHDBCmd().

Here is the call graph for this function:

◆ Do()

bool AddIUFromHDBCmd::Do ( )
virtual

Executes the command.

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

Implements GUICommand.

Definition at line 65 of file AddIUFromHDBCmd.cc.

65  {
66 
67  assert(parentWindow() != NULL);
68  assert(view() != NULL);
69 
70  Model* model = dynamic_cast<MDFDocument*>(
71  view()->GetDocument())->getModel();
72 
73 
74  AddIUFromHDBDialog dialog(parentWindow(), model);
75 
76  dialog.ShowModal();
77  return true;
78 }

References assert, GUICommand::parentWindow(), and EditorCommand::view().

Here is the call graph for this function:

◆ icon()

string AddIUFromHDBCmd::icon ( ) const
virtual

Returns path to the command's icon file.

Reimplemented from EditorCommand.

Definition at line 104 of file AddIUFromHDBCmd.cc.

104  {
106 }

References ProDeConstants::CMD_ICON_DEFAULT.

◆ id()

int AddIUFromHDBCmd::id ( ) const
virtual

Returns id of this command.

Implements GUICommand.

Definition at line 85 of file AddIUFromHDBCmd.cc.

85  {
87 }

References ProDeConstants::COMMAND_ADD_IU_FROM_HDB.

◆ isEnabled()

bool AddIUFromHDBCmd::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 126 of file AddIUFromHDBCmd.cc.

126  {
127  wxDocManager* manager = wxGetApp().docManager();
128  if (manager->GetCurrentView() != NULL) {
129  return true;
130  }
131  return false;
132 }

◆ shortName()

string AddIUFromHDBCmd::shortName ( ) const
virtual

Returns short version of the command name.

Reimplemented from GUICommand.

Definition at line 113 of file AddIUFromHDBCmd.cc.

113  {
115 }

References ProDeConstants::CMD_SNAME_ADD_IU_FROM_HDB.


The documentation for this class was generated from the following files:
AddIUFromHDBDialog
Definition: AddIUFromHDBDialog.hh:61
ProDeConstants::CMD_NAME_ADD_IU_FROM_HDB
static const std::string CMD_NAME_ADD_IU_FROM_HDB
Command name for the "Add IU From hdb" command.
Definition: ProDeConstants.hh:112
ProDeConstants::CMD_SNAME_ADD_IU_FROM_HDB
static const std::string CMD_SNAME_ADD_IU_FROM_HDB
Short command name for the "Add IU from hdb" command.
Definition: ProDeConstants.hh:224
EditorCommand::EditorCommand
EditorCommand(std::string name, wxWindow *parent=NULL)
Definition: EditorCommand.cc:42
assert
#define assert(condition)
Definition: Application.hh:86
EditorCommand::view
wxView * view() const
Definition: EditorCommand.cc:76
MDFDocument
Definition: MDFDocument.hh:51
AddIUFromHDBCmd::AddIUFromHDBCmd
AddIUFromHDBCmd()
Definition: AddIUFromHDBCmd.cc:48
ProDeConstants::CMD_ICON_DEFAULT
static const std::string CMD_ICON_DEFAULT
Icon path for default icon of commands.
Definition: ProDeConstants.hh:286
Model
Definition: Model.hh:50
ProDeConstants::COMMAND_ADD_IU_FROM_HDB
@ COMMAND_ADD_IU_FROM_HDB
Definition: ProDeConstants.hh:427
GUICommand::parentWindow
wxWindow * parentWindow() const
Definition: GUICommand.cc:75