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

@@ -872,11 +872,7 @@ bool wxGnomePrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt )
return false;
}
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( dc->GetResolution(),
dc->GetResolution() );
@@ -2099,12 +2095,8 @@ void wxGnomePrintPreview::DetermineScaling()
if (paper)
{
wxSize ScreenPixels = wxGetDisplaySize();
wxSize ScreenMM = wxGetDisplaySizeMM();
m_previewPrintout->SetPPIScreen(wxGetDisplayPPI());
m_previewPrintout->SetPPIScreen( (int) ((ScreenPixels.GetWidth() * 25.4) / ScreenMM.GetWidth()),
(int) ((ScreenPixels.GetHeight() * 25.4) / ScreenMM.GetHeight()) );
int resolution = DPI;
m_previewPrintout->SetPPIPrinter( resolution, resolution );