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

#include <PrintPreviewCmd.hh>

Inheritance diagram for PrintPreviewCmd:
Inheritance graph
Collaboration diagram for PrintPreviewCmd:
Collaboration graph

Public Member Functions

 PrintPreviewCmd ()
 
virtual ~PrintPreviewCmd ()
 
virtual bool Do ()
 
virtual int id () const
 
virtual PrintPreviewCmdcreate () 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 previewing print of documents.

Definition at line 42 of file PrintPreviewCmd.hh.

Constructor & Destructor Documentation

◆ PrintPreviewCmd()

PrintPreviewCmd::PrintPreviewCmd ( )

The Constructor.

Definition at line 46 of file PrintPreviewCmd.cc.

Referenced by create().

◆ ~PrintPreviewCmd()

PrintPreviewCmd::~PrintPreviewCmd ( )
virtual

The Destructor.

Definition at line 55 of file PrintPreviewCmd.cc.

55  {
56 }

Member Function Documentation

◆ create()

PrintPreviewCmd * PrintPreviewCmd::create ( ) const
virtual

Creates and returns a new instance of this command.

Returns
Newly created instance of this command.

Implements GUICommand.

Definition at line 114 of file PrintPreviewCmd.cc.

114  {
115  return new PrintPreviewCmd();
116 }

References PrintPreviewCmd().

Here is the call graph for this function:

◆ Do()

bool PrintPreviewCmd::Do ( )
virtual

Executes the command.

If the wxWidgets printing framework was not compiled in the wxWidgets library, print previeving is not possible. An error message will be displayed instead of previewing.

Returns
Always false. The command is not undoable.

Implements GUICommand.

Definition at line 69 of file PrintPreviewCmd.cc.

69  {
70 
71 #if WX_PRINTING_DISABLED
72 
73  // wxWidgets was compiled without printing framework, display an
74  // error message.
75 
76  wxString message =
77  wxString(_T("Printing framework is disabled in the wxWidgets\n"));
78 
79  message.Append(_T("library. Print previewing is not possible."));
80 
81  ErrorDialog error(parentWindow(), message);
82  error.ShowModal();
83  return false;
84 
85 #else
86 
87  // wxWidgets was compiled with the printing framework.
88  wxCommandEvent dummy;
89  wxGetApp().docManager()->OnPreview(dummy);
90  return false;
91 
92 #endif // WX_PRINTING_ENABLED
93 
94 }

References dummy, and GUICommand::parentWindow().

Here is the call graph for this function:

◆ icon()

string PrintPreviewCmd::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 136 of file PrintPreviewCmd.cc.

136  {
138 }

References ProDeConstants::CMD_ICON_PRINT_PREVIEW.

◆ id()

int PrintPreviewCmd::id ( ) const
virtual

Return id of this command.

Returns
ID for this command to be used in menus and toolbars.

Implements GUICommand.

Definition at line 103 of file PrintPreviewCmd.cc.

103  {
105 }

References ProDeConstants::COMMAND_PRINT_PREVIEW.

◆ isEnabled()

bool PrintPreviewCmd::isEnabled ( )
virtual

Returns true when command is executable, false when not.

This command is executable when a document is open.

Returns
True, if the command is executable.

Reimplemented from EditorCommand.

Definition at line 149 of file PrintPreviewCmd.cc.

149  {
150  wxDocManager* manager = wxGetApp().docManager();
151  if (manager->GetCurrentView() != NULL) {
152  return true;
153  }
154  return false;
155 }

◆ shortName()

string PrintPreviewCmd::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 125 of file PrintPreviewCmd.cc.

125  {
127 }

References ProDeConstants::CMD_SNAME_PRINT_PREVIEW.


The documentation for this class was generated from the following files:
PrintPreviewCmd::PrintPreviewCmd
PrintPreviewCmd()
Definition: PrintPreviewCmd.cc:46
ProDeConstants::CMD_ICON_PRINT_PREVIEW
static const std::string CMD_ICON_PRINT_PREVIEW
Icon location for the "Print Preview" command.
Definition: ProDeConstants.hh:302
EditorCommand::EditorCommand
EditorCommand(std::string name, wxWindow *parent=NULL)
Definition: EditorCommand.cc:42
ProDeConstants::CMD_SNAME_PRINT_PREVIEW
static const std::string CMD_SNAME_PRINT_PREVIEW
Command name for the "Print Preview" command.
Definition: ProDeConstants.hh:202
ErrorDialog
Definition: ErrorDialog.hh:42
dummy
SimValue dummy(32)
a dummy simvalue which is given for operands that are not bound
ProDeConstants::COMMAND_PRINT_PREVIEW
@ COMMAND_PRINT_PREVIEW
Definition: ProDeConstants.hh:413
ProDeConstants::CMD_NAME_PRINT_PREVIEW
static const std::string CMD_NAME_PRINT_PREVIEW
Command name for the "Print Preview" command.
Definition: ProDeConstants.hh:86
GUICommand::parentWindow
wxWindow * parentWindow() const
Definition: GUICommand.cc:75