Question

I have managed to attach my filename to my print out by overloading the wxPrintout constructor with my chosen name.

 wxPrintout(const wxString& title = wxT("Printout"));

In my code:

VRPrintout::VRPrintout(blababala):wxPrintout(_("Heartrate")),

But on printing to save as a PDF, in the filename dialog, it reads "Printing Heartrate".

How can I get rid of "Printing" added before the name or even change it?

Was it helpful?

Solution

@Credits to Xaviou from wxDev.fr.

You can try overriding the "OnBeginDocument" method in your wxPrintout derived class.

The default code is the following (the "OnBeginDocument" is virtual) in wx-src/common/prntbase.cpp:584 :

 bool wxPrintout::OnBeginDocument(int WXUNUSED(startPage), int WXUNUSED(endPage))
{
   return GetDC()->StartDoc(_("Printing ") + m_printoutTitle);
}

I think that if you provide yours with the correct text, it should be ok.

Regards Xav'

Edit : Tested on an app of mine that do printing stuff, and it works...

Worked for me too

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top