OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
ModifyIUCmd Class Reference

#include <ModifyIUCmd.hh>

Inheritance diagram for ModifyIUCmd:
Inheritance graph
Collaboration diagram for ModifyIUCmd:
Collaboration graph

Public Member Functions

 ModifyIUCmd (EditPart *editPart)
 
virtual ~ModifyIUCmd ()
 
virtual bool Do ()
 
- Public Member Functions inherited from ComponentCommand
 ComponentCommand ()
 
virtual ~ComponentCommand ()
 
wxWindow * parentWindow ()
 
void setParentWindow (wxWindow *window)
 

Private Attributes

EditParteditPart_
 Immediate unit to modify. More...
 

Detailed Description

Command which displays a immediate unit dialog with precompleted values for modifying a immediate unit.

Definition at line 43 of file ModifyIUCmd.hh.

Constructor & Destructor Documentation

◆ ModifyIUCmd()

ModifyIUCmd::ModifyIUCmd ( EditPart editPart)

The Constructor.

Definition at line 43 of file ModifyIUCmd.cc.

43  :
44  editPart_(editPart) {
45 
46 }

◆ ~ModifyIUCmd()

ModifyIUCmd::~ModifyIUCmd ( )
virtual

The Destructor.

Definition at line 52 of file ModifyIUCmd.cc.

52  {
53 }

Member Function Documentation

◆ Do()

bool ModifyIUCmd::Do ( )
virtual

Executes the command.

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

Implements ComponentCommand.

Definition at line 62 of file ModifyIUCmd.cc.

62  {
63 
64  ImmediateUnit* iu = dynamic_cast<ImmediateUnit*>(editPart_->model());
65  assert (iu != NULL);
66  assert (parentWindow() != NULL);
67 
68  IUDialog dialog(parentWindow(), iu);
69 
70  if (dialog.ShowModal() == wxID_OK) {
71  // immediate unit was modified
72  return true;
73  } else {
74  // modification was cancelled
75  return false;
76  }
77 
78  return false;
79 }

References assert, editPart_, EditPart::model(), and ComponentCommand::parentWindow().

Here is the call graph for this function:

Member Data Documentation

◆ editPart_

EditPart* ModifyIUCmd::editPart_
private

Immediate unit to modify.

Definition at line 51 of file ModifyIUCmd.hh.

Referenced by Do().


The documentation for this class was generated from the following files:
assert
#define assert(condition)
Definition: Application.hh:86
EditPart::model
TTAMachine::MachinePart * model() const
IUDialog
Definition: IUDialog.hh:48
ModifyIUCmd::editPart_
EditPart * editPart_
Immediate unit to modify.
Definition: ModifyIUCmd.hh:51
ComponentCommand::parentWindow
wxWindow * parentWindow()
Definition: ComponentCommand.cc:66
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50