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

#include <SaveDocumentAsCmd.hh>

Inheritance diagram for SaveDocumentAsCmd:
Inheritance graph
Collaboration diagram for SaveDocumentAsCmd:
Collaboration graph

Public Member Functions

 SaveDocumentAsCmd ()
 
virtual ~SaveDocumentAsCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual SaveDocumentAsCmdcreate () const
 
virtual std::string shortName () const
 
virtual std::string icon () 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

EditorCommand for saving documents with a new name.

Definition at line 41 of file SaveDocumentAsCmd.hh.

Constructor & Destructor Documentation

◆ SaveDocumentAsCmd()

SaveDocumentAsCmd::SaveDocumentAsCmd ( )

The Constructor.

Definition at line 43 of file SaveDocumentAsCmd.cc.

Referenced by create().

◆ ~SaveDocumentAsCmd()

SaveDocumentAsCmd::~SaveDocumentAsCmd ( )
virtual

The Destructor.

Definition at line 52 of file SaveDocumentAsCmd.cc.

52 {}

Member Function Documentation

◆ create()

SaveDocumentAsCmd * SaveDocumentAsCmd::create ( ) const
virtual

Creates and returns a new instance of this command.

Returns
Newly created instance of this command.

Implements GUICommand.

Definition at line 87 of file SaveDocumentAsCmd.cc.

87  {
88  return new SaveDocumentAsCmd();
89 }

References SaveDocumentAsCmd().

Here is the call graph for this function:

◆ Do()

bool SaveDocumentAsCmd::Do ( )
virtual

Executes the command.

Returns
Always false. Returning true here would cause problems with the wxCommandProcessor, and the command is never undoable so it's safe to return false even if the command was succesfully executed.

Implements GUICommand.

Definition at line 63 of file SaveDocumentAsCmd.cc.

63  {
64  wxCommandEvent dummy(wxID_SAVEAS, 0);
65  wxGetApp().docManager()->OnFileSaveAs(dummy);
66  return false;
67 }

References dummy.

◆ icon()

string SaveDocumentAsCmd::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 108 of file SaveDocumentAsCmd.cc.

108  {
110 }

References ProDeConstants::CMD_ICON_SAVEAS_DOC.

◆ id()

int SaveDocumentAsCmd::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 76 of file SaveDocumentAsCmd.cc.

76  {
78 }

References ProDeConstants::COMMAND_SAVEAS_DOC.

◆ isEnabled()

bool SaveDocumentAsCmd::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 121 of file SaveDocumentAsCmd.cc.

121  {
122  wxDocManager* manager = wxGetApp().docManager();
123  if (manager->GetCurrentView() != NULL) {
124  return true;
125  }
126  return false;
127 }

◆ shortName()

string SaveDocumentAsCmd::shortName ( ) const
virtual

Returns short version of the command name.

Returns
Short name of the command to be used in the toolbar.

Reimplemented from GUICommand.

Definition at line 98 of file SaveDocumentAsCmd.cc.

98  {
100 }

References ProDeConstants::CMD_SNAME_SAVEAS_DOC.


The documentation for this class was generated from the following files:
ProDeConstants::CMD_NAME_SAVEAS_DOC
static const std::string CMD_NAME_SAVEAS_DOC
Command name for the "Save Document As" command.
Definition: ProDeConstants.hh:82
SaveDocumentAsCmd::SaveDocumentAsCmd
SaveDocumentAsCmd()
Definition: SaveDocumentAsCmd.cc:43
ProDeConstants::CMD_SNAME_SAVEAS_DOC
static const std::string CMD_SNAME_SAVEAS_DOC
Command name for the "Save Document As" command.
Definition: ProDeConstants.hh:196
ProDeConstants::CMD_ICON_SAVEAS_DOC
static const std::string CMD_ICON_SAVEAS_DOC
Icon location for the "Save Document As" command.
Definition: ProDeConstants.hh:294
EditorCommand::EditorCommand
EditorCommand(std::string name, wxWindow *parent=NULL)
Definition: EditorCommand.cc:42
dummy
SimValue dummy(32)
a dummy simvalue which is given for operands that are not bound
ProDeConstants::COMMAND_SAVEAS_DOC
@ COMMAND_SAVEAS_DOC
Definition: ProDeConstants.hh:411