Audacity 3.2.0
Classes | Functions | Variables
anonymous_namespace{Printing.cpp} Namespace Reference

Classes

class  AudacityPrintout
 

Functions

wxPrintData & gPrintData ()
 
void HandlePageSetup (wxWindow *parent)
 
void HandlePrint (wxWindow *parent, const wxString &name, TrackList *tracks, TrackPanel &panel)
 
void OnPageSetup (const CommandContext &context)
 
void OnPrint (const CommandContext &context)
 
auto PrintingItems ()
 

Variables

AttachedItem sAttachment
 

Function Documentation

◆ gPrintData()

wxPrintData & anonymous_namespace{Printing.cpp}::gPrintData ( )

Definition at line 45 of file Printing.cpp.

46{
47 static wxPrintData theData;
48 return theData;
49}

Referenced by HandlePageSetup(), and HandlePrint().

Here is the caller graph for this function:

◆ HandlePageSetup()

void anonymous_namespace{Printing.cpp}::HandlePageSetup ( wxWindow *  parent)

Definition at line 168 of file Printing.cpp.

169{
170 wxPageSetupData pageSetupData;
171
172 wxPageSetupDialog pageSetupDialog(parent, &pageSetupData);
173 pageSetupDialog.ShowModal();
174
175 gPrintData() = pageSetupDialog.GetPageSetupData().GetPrintData();
176}

References gPrintData().

Referenced by OnPageSetup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HandlePrint()

void anonymous_namespace{Printing.cpp}::HandlePrint ( wxWindow *  parent,
const wxString &  name,
TrackList tracks,
TrackPanel panel 
)

Definition at line 178 of file Printing.cpp.

181{
182 wxPrintDialogData printDialogData(gPrintData());
183
184 wxPrinter printer(&printDialogData);
185 AudacityPrintout printout(name, tracks, panel);
186 if (!printer.Print(parent, &printout, true)) {
187 if (wxPrinter::GetLastError() == wxPRINTER_ERROR) {
189 XO("There was a problem printing."),
190 XO("Print"),
191 wxOK);
192 }
193 else {
194 // Do nothing, the user cancelled...
195 }
196 }
197 else {
198 gPrintData() = printer.GetPrintDialogData().GetPrintData();
199 }
200}
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
const TranslatableString name
Definition: Distortion.cpp:76
XO("Cut/Copy/Paste")
const auto tracks

References AudacityMessageBox(), gPrintData(), name, tracks, and XO().

Referenced by OnPrint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnPageSetup()

void anonymous_namespace{Printing.cpp}::OnPageSetup ( const CommandContext context)

Definition at line 202 of file Printing.cpp.

203{
204 auto &project = context.project;
205 auto &window = GetProjectFrame( project );
206 HandlePageSetup(&window);
207}
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
const auto project
AudacityProject & project
void HandlePageSetup(wxWindow *parent)
Definition: Printing.cpp:168

References GetProjectFrame(), HandlePageSetup(), CommandContext::project, and project.

Referenced by PrintingItems().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnPrint()

void anonymous_namespace{Printing.cpp}::OnPrint ( const CommandContext context)

Definition at line 209 of file Printing.cpp.

210{
211 auto &project = context.project;
212 auto name = project.GetProjectName();
213 auto &tracks = TrackList::Get( project );
214 auto &window = GetProjectFrame( project );
216}
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:347
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:233
void HandlePrint(wxWindow *parent, const wxString &name, TrackList *tracks, TrackPanel &panel)
Definition: Printing.cpp:178

References TrackList::Get(), TrackPanel::Get(), GetProjectFrame(), HandlePrint(), name, CommandContext::project, project, and tracks.

Referenced by PrintingItems().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintingItems()

auto anonymous_namespace{Printing.cpp}::PrintingItems ( )

Definition at line 219 of file Printing.cpp.

220{
221 static auto items = std::shared_ptr{
222 Section( "Print",
223 Command( wxT("PageSetup"), XXO("Pa&ge Setup..."), OnPageSetup,
225 /* i18n-hint: (verb) It's item on a menu. */
226 Command( wxT("Print"), XXO("&Print..."), OnPrint,
228 ) };
229 return items;
230}
wxT("CloseDown"))
const ReservedCommandFlag & AudioIONotBusyFlag()
const ReservedCommandFlag & TracksExistFlag()
XXO("&Cut/Copy/Paste Toolbar")
constexpr auto Section
Definition: MenuRegistry.h:436
constexpr auto Command
Definition: MenuRegistry.h:456
void OnPrint(const CommandContext &context)
Definition: Printing.cpp:209
void OnPageSetup(const CommandContext &context)
Definition: Printing.cpp:202

References AudioIONotBusyFlag(), MenuRegistry::Command, OnPageSetup(), OnPrint(), MenuRegistry::Section, TracksExistFlag(), wxT(), and XXO().

Here is the call graph for this function:

Variable Documentation

◆ sAttachment

AttachedItem anonymous_namespace{Printing.cpp}::sAttachment
Initial value:
{ "File", { OrderingHint::Before, "Exit" } }
}
std::unique_ptr< detail::IndirectItem< Item > > Indirect(const std::shared_ptr< Item > &ptr)
A convenience function.
Definition: Registry.h:175

Definition at line 232 of file Printing.cpp.