Audacity  2.2.2
Functions
Printing.h File Reference
#include <wx/defs.h>
#include <wx/string.h>

Go to the source code of this file.

Functions

void HandlePageSetup (wxWindow *parent)
 
void HandlePrint (wxWindow *parent, const wxString &name, TrackList *tracks)
 

Function Documentation

void HandlePageSetup ( wxWindow *  parent)

Definition at line 136 of file Printing.cpp.

References gPrintData().

Referenced by AudacityProject::OnPageSetup().

137 {
138  wxPageSetupData pageSetupData;
139 
140  wxPageSetupDialog pageSetupDialog(parent, &pageSetupData);
141  pageSetupDialog.ShowModal();
142 
143  gPrintData() = pageSetupDialog.GetPageSetupData().GetPrintData();
144 }
wxPrintData & gPrintData()
Definition: Printing.cpp:39
void HandlePrint ( wxWindow *  parent,
const wxString &  name,
TrackList tracks 
)

Definition at line 146 of file Printing.cpp.

References _(), AudacityMessageBox(), and gPrintData().

Referenced by AudacityProject::OnPrint().

147 {
148  wxPrintDialogData printDialogData(gPrintData());
149 
150  wxPrinter printer(&printDialogData);
151  AudacityPrintout printout(name, tracks);
152  if (!printer.Print(parent, &printout, true)) {
153  if (wxPrinter::GetLastError() == wxPRINTER_ERROR) {
154  AudacityMessageBox(_("There was a problem printing."),
155  _("Print"), wxOK);
156  }
157  else {
158  // Do nothing, the user cancelled...
159  }
160  }
161  else {
162  gPrintData() = printer.GetPrintDialogData().GetPrintData();
163  }
164 }
int AudacityMessageBox(const wxString &message, const wxString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: ErrorDialog.h:92
wxPrintData & gPrintData()
Definition: Printing.cpp:39
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
const wxChar * name
Definition: Distortion.cpp:94
Derived from wxPrintout, this class helps with printing.
Definition: Printing.cpp:45