27 m_TextControl(control)
57 if (page && page<maxpage)
87 GetPPIScreen (&ppiScr.x, &ppiScr.y);
88 if (ppiScr.x == 0 || ppiScr.y == 0)
97 wxPrintPaperDatabase paperDB;
98 paperDB.CreateDatabase();
108 page.x =
static_cast<int> (page.x * ppiScr.x / 254);
109 page.y =
static_cast<int> (page.y * ppiScr.y / 254);
122 top =
static_cast<int> (top * ppiScr.y / 25.4);
123 bottom =
static_cast<int> (bottom * ppiScr.y / 25.4);
124 left =
static_cast<int> (left * ppiScr.x / 25.4);
125 right =
static_cast<int> (right * ppiScr.x / 25.4);
128 page.x - (left + right),
129 page.y - (top + bottom));
157 *selPageFrom = *minPage;
158 *selPageTo = *maxPage;
164 bool result = wxPrintout::OnBeginDocument(startPage, endPage);
169 if( startPage > maxpage || endPage > maxpage )
183 GetPPIScreen (&ppiScr.x, &ppiScr.y);
190 GetPPIPrinter (&ppiPrt.x, &ppiPrt.y);
196 wxSize dcSize = dc->GetSize();
198 GetPageSizePixels (&pageSize.x, &pageSize.y);
200 float scale_x = (float)(ppiPrt.x * dcSize.x) /
201 (float)(ppiScr.x * pageSize.x);
202 float scale_y = (float)(ppiPrt.y * dcSize.y) /
203 (float)(ppiScr.y * pageSize.y);
204 dc->SetUserScale (scale_x, scale_y);
wxString F(const wxChar *msg,...)
sprintf-like function
wxPrintOrientation GetOrientation() const
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
bool HasPage(int page) override
int GetSelectionStart() const
Returns the position at the start of the selection.
wxArrayInt * m_pPageSelStart
wxString GetSelectedText()
Retrieve the selected text.
wxPrintData & GetPrintData()
wxPaperSize GetPaperId() const
bool OnBeginDocument(int startPage, int endPage) override
LogManager * GetLogManager() const
int GetLength() const
Returns the number of bytes in the document.
int GetSelectionEnd() const
Returns the position at the end of the selection.
cbStyledTextCtrl * m_TextControl
wxArray< int > wxArrayInt
void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) override
bool OnPrintPage(int page) override
cbEditorPrintout(const wxString &title, cbStyledTextCtrl *control, bool selectionOnly)
void DebugLog(const wxString &msg, Logger::level lv=Logger::info)
virtual wxPrintDialogData & GetPrintDialogData() const
~cbEditorPrintout() override