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

#include <ProximFindCmd.hh>

Inheritance diagram for ProximFindCmd:
Inheritance graph
Collaboration diagram for ProximFindCmd:
Collaboration graph

Public Member Functions

 ProximFindCmd ()
 
virtual ~ProximFindCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual ProximFindCmdcreate () const
 
virtual std::string icon () const
 
virtual bool isEnabled ()
 
- 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

Command for displaying Proxim disassembly search window.

Definition at line 42 of file ProximFindCmd.hh.

Constructor & Destructor Documentation

◆ ProximFindCmd()

ProximFindCmd::ProximFindCmd ( )

Definition at line 42 of file ProximFindCmd.cc.

42  :
44 }

Referenced by create().

◆ ~ProximFindCmd()

ProximFindCmd::~ProximFindCmd ( )
virtual

Definition at line 47 of file ProximFindCmd.cc.

47  {
48 }

Member Function Documentation

◆ create()

ProximFindCmd * ProximFindCmd::create ( ) const
virtual

Creates and returns a new instance of this command.

Returns
Newly created instance of this command.

Implements GUICommand.

Definition at line 113 of file ProximFindCmd.cc.

113  {
114  return new ProximFindCmd();
115 }

References ProximFindCmd().

Here is the call graph for this function:

◆ Do()

bool ProximFindCmd::Do ( )
virtual

Executes the command.

Implements GUICommand.

Definition at line 55 of file ProximFindCmd.cc.

55  {
56 
58 
59  if (simulation->isSimulationInitialized() ||
60  simulation->isSimulationRunning() ||
61  simulation->isSimulationStopped()) {
62 
63  FindWindow* findWindow = dynamic_cast<FindWindow*>(
65  FindWindowById(ProximConstants::ID_FIND_WINDOW));
66 
67  if (findWindow == NULL) {
68  findWindow = new FindWindow(ProximToolbox::mainFrame(),
70 
72  findWindow, _T("Find pattern in disassembly"), false,
73  wxSize(300, 160));
74  findWindow->GetParent()->Center();
75 
76  findWindow->GetParent()->SetSize(300, 160);
77  }
78  } else {
79  ErrorDialog error(parentWindow(), _T("Simulation not initialized."));
80  error.ShowModal();
81  }
82 
83  return true;
84 }

References ProximToolbox::addFramedWindow(), ProximToolbox::frontend(), ProximConstants::ID_FIND_WINDOW, SimulatorFrontend::isSimulationInitialized(), SimulatorFrontend::isSimulationRunning(), SimulatorFrontend::isSimulationStopped(), ProximToolbox::mainFrame(), and GUICommand::parentWindow().

Here is the call graph for this function:

◆ icon()

std::string ProximFindCmd::icon ( ) const
virtual

Returns full path to the command icon file.

Returns
Full path to the command icon file.

Implements GUICommand.

Definition at line 93 of file ProximFindCmd.cc.

93  {
94  return "find.png";
95 }

◆ id()

int ProximFindCmd::id ( ) const
virtual

Returns ID of this command.

Implements GUICommand.

Definition at line 102 of file ProximFindCmd.cc.

102  {
104 }

References ProximConstants::COMMAND_FIND.

◆ isEnabled()

bool ProximFindCmd::isEnabled ( )
virtual

Returns true if the command is enabled, false otherwise.

Returns
Always true.

Implements GUICommand.

Definition at line 124 of file ProximFindCmd.cc.

124  {
125  return true;
126 }

The documentation for this class was generated from the following files:
ProximToolbox::frontend
static TracedSimulatorFrontend * frontend()
Definition: ProximToolbox.cc:223
ProximToolbox::mainFrame
static ProximMainFrame * mainFrame()
Definition: ProximToolbox.cc:105
ProximConstants::ID_FIND_WINDOW
@ ID_FIND_WINDOW
Definition: ProximConstants.hh:98
ProximFindCmd::ProximFindCmd
ProximFindCmd()
Definition: ProximFindCmd.cc:42
SimulatorFrontend::isSimulationStopped
bool isSimulationStopped() const
Definition: SimulatorFrontend.cc:1271
FindWindow
Definition: FindWindow.hh:49
ErrorDialog
Definition: ErrorDialog.hh:42
ProximConstants::COMMAND_NAME_FIND
static const std::string COMMAND_NAME_FIND
Name of the find command.
Definition: ProximConstants.hh:140
ProximToolbox::addFramedWindow
static void addFramedWindow(wxWindow *window, const wxString &title, bool stayOnTop=false, const wxSize &minSize=wxSize(100, 100))
Definition: ProximToolbox.cc:176
SimulatorFrontend::isSimulationRunning
bool isSimulationRunning() const
Definition: SimulatorFrontend.cc:1260
GUICommand::GUICommand
GUICommand(std::string name, wxWindow *parent)
Definition: GUICommand.cc:42
ProximConstants::COMMAND_FIND
@ COMMAND_FIND
Definition: ProximConstants.hh:71
SimulatorFrontend
Definition: SimulatorFrontend.hh:89
GUICommand::parentWindow
wxWindow * parentWindow() const
Definition: GUICommand.cc:75
SimulatorFrontend::isSimulationInitialized
bool isSimulationInitialized() const
Definition: SimulatorFrontend.cc:1228