added wxGetDisplayPPI() convenience function and wxPrintout::SetPPI*() overloads accepting single wxSize argument

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2008-09-21 09:35:49 +00:00
parent 0c75b29e1e
commit 40fcf546f6
6 changed files with 28 additions and 20 deletions

View File

@@ -926,11 +926,8 @@ void wxGtkPrinter::BeginPrint(wxPrintout *printout, GtkPrintOperation *operation
}
return;
}
wxSize ScreenPixels = wxGetDisplaySize();
wxSize ScreenMM = wxGetDisplaySizeMM();
printout->SetPPIScreen( (int) ((ScreenPixels.GetWidth() * 25.4) / ScreenMM.GetWidth()),
(int) ((ScreenPixels.GetHeight() * 25.4) / ScreenMM.GetHeight()) );
printout->SetPPIScreen(wxGetDisplayPPI());
printout->SetPPIPrinter( printDC->GetResolution(),
printDC->GetResolution() );
@@ -2366,12 +2363,7 @@ void wxGtkPrintPreview::DetermineScaling()
if (paper)
{
wxSize ScreenPixels = wxGetDisplaySize();
wxSize ScreenMM = wxGetDisplaySizeMM();
m_previewPrintout->SetPPIScreen( (int) ((ScreenPixels.GetWidth() * 25.4) / ScreenMM.GetWidth()),
(int) ((ScreenPixels.GetHeight() * 25.4) / ScreenMM.GetHeight()) );
m_previewPrintout->SetPPIScreen(wxGetDisplayPPI());
m_previewPrintout->SetPPIPrinter( m_resolution, m_resolution );
// Get width and height in points (1/72th of an inch)