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

#include <ProximCDCmd.hh>

Inheritance diagram for ProximCDCmd:
Inheritance graph
Collaboration diagram for ProximCDCmd:
Collaboration graph

Public Member Functions

 ProximCDCmd ()
 
virtual ~ProximCDCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual ProximCDCmdcreate () 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 changing the Proxim working directory.

The command displays a directory dialog for choosing a new working directory.

Definition at line 44 of file ProximCDCmd.hh.

Constructor & Destructor Documentation

◆ ProximCDCmd()

ProximCDCmd::ProximCDCmd ( )

The Constructor.

Definition at line 43 of file ProximCDCmd.cc.

43  :
44  GUICommand("Change Directory", NULL) {
45 
46  }

Referenced by create().

◆ ~ProximCDCmd()

ProximCDCmd::~ProximCDCmd ( )
virtual

The Destructor.

Definition at line 51 of file ProximCDCmd.cc.

51  {
52 }

Member Function Documentation

◆ create()

ProximCDCmd * ProximCDCmd::create ( ) const
virtual

Creates and returns a new isntance of this command.

Returns
Newly created instance of this command.

Implements GUICommand.

Definition at line 102 of file ProximCDCmd.cc.

102  {
103  return new ProximCDCmd();
104 }

References ProximCDCmd().

Here is the call graph for this function:

◆ Do()

bool ProximCDCmd::Do ( )
virtual

Executes the command.

Implements GUICommand.

Definition at line 59 of file ProximCDCmd.cc.

59  {
60 
61  assert(parentWindow() != NULL);
62  wxDirDialog dialog(parentWindow(), _T("Choose a directory"), wxGetCwd());
63 
64  if (dialog.ShowModal() == wxID_CANCEL) {
65  return false;
66  }
67 
68  std::string command =
69  "cd \"" + WxConversion::toString(dialog.GetPath()) + "\"";
70 
71  wxGetApp().simulation()->lineReader().input(command);
72  return true;
73 }

References assert, GUICommand::parentWindow(), and WxConversion::toString().

Here is the call graph for this function:

◆ icon()

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

Returns full path to the command icon file.

Returns
Full path to the command icon file.

Implements GUICommand.

Definition at line 82 of file ProximCDCmd.cc.

82  {
83  return "cd.png";
84 }

◆ id()

int ProximCDCmd::id ( ) const
virtual

Returns ID of this command.

Implements GUICommand.

Definition at line 91 of file ProximCDCmd.cc.

91  {
93 }

References ProximConstants::COMMAND_CD.

◆ isEnabled()

bool ProximCDCmd::isEnabled ( )
virtual

Returns true if the command is enabled, false otherwise.

Returns
Always true.

Implements GUICommand.

Definition at line 113 of file ProximCDCmd.cc.

113  {
114  return true;
115 }

The documentation for this class was generated from the following files:
assert
#define assert(condition)
Definition: Application.hh:86
GUICommand::GUICommand
GUICommand(std::string name, wxWindow *parent)
Definition: GUICommand.cc:42
ProximCDCmd::ProximCDCmd
ProximCDCmd()
Definition: ProximCDCmd.cc:43
ProximConstants::COMMAND_CD
@ COMMAND_CD
Definition: ProximConstants.hh:54
WxConversion::toString
static std::string toString(const wxString &source)
GUICommand::parentWindow
wxWindow * parentWindow() const
Definition: GUICommand.cc:75