Printing improvements: GetPageInfo() gets called after the DC has
been set and after OnPreparePrinting() has been called so it can report the number of pages accurately; doesn't try to set number of pages in print dialog, in common with other Windows apps; wxHTML easy printing's preview shows number of pages correctly; preview scrollbars are set correctly; keyboard navigation improved git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -178,13 +178,11 @@ void wxHtmlPrintout::AddFilter(wxHtmlFilter *filter)
|
||||
m_Filters.Append(filter);
|
||||
}
|
||||
|
||||
bool wxHtmlPrintout::OnBeginDocument(int startPage, int endPage)
|
||||
void wxHtmlPrintout::OnPreparePrinting()
|
||||
{
|
||||
int pageWidth, pageHeight, mm_w, mm_h, scr_w, scr_h, dc_w, dc_h;
|
||||
float ppmm_h, ppmm_v;
|
||||
|
||||
if (!wxPrintout::OnBeginDocument(startPage, endPage)) return FALSE;
|
||||
|
||||
GetPageSizePixels(&pageWidth, &pageHeight);
|
||||
GetPageSizeMM(&mm_w, &mm_h);
|
||||
ppmm_h = (float)pageWidth / mm_w;
|
||||
@@ -236,6 +234,12 @@ bool wxHtmlPrintout::OnBeginDocument(int startPage, int endPage)
|
||||
));
|
||||
m_Renderer->SetHtmlText(m_Document, m_BasePath, m_BasePathIsDir);
|
||||
CountPages();
|
||||
}
|
||||
|
||||
bool wxHtmlPrintout::OnBeginDocument(int startPage, int endPage)
|
||||
{
|
||||
if (!wxPrintout::OnBeginDocument(startPage, endPage)) return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -256,9 +260,9 @@ bool wxHtmlPrintout::OnPrintPage(int page)
|
||||
void wxHtmlPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo)
|
||||
{
|
||||
*minPage = 1;
|
||||
*maxPage = wxHTML_PRINT_MAX_PAGES;
|
||||
*maxPage = m_NumPages;
|
||||
*selPageFrom = 1;
|
||||
*selPageTo = wxHTML_PRINT_MAX_PAGES;
|
||||
*selPageTo = m_NumPages;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user