Add wxHtmlPrintout::SetMargins(wxPageSetupDialogData) overload
Make it simpler to set the user-configured margins. Closes #16872.
This commit is contained in:
committed by
Vadim Zeitlin
parent
10a2049093
commit
c9a3a23e5a
@@ -156,9 +156,11 @@ public:
|
||||
|
||||
void SetMargins(float top = 25.2f, float bottom = 25.2f, float left = 25.2f, float right = 25.2f,
|
||||
float spaces = 5);
|
||||
// sets margins in milimeters. Defaults to 1 inch for margins and 0.5cm for space
|
||||
// sets margins in millimeters. Defaults to 1 inch for margins and 0.5cm for space
|
||||
// between text and header and/or footer
|
||||
|
||||
void SetMargins(const wxPageSetupDialogData& pageSetupData);
|
||||
|
||||
// wxPrintout stuff:
|
||||
bool OnPrintPage(int page) wxOVERRIDE;
|
||||
bool HasPage(int page) wxOVERRIDE;
|
||||
|
@@ -444,5 +444,12 @@ public:
|
||||
float left = 25.2,
|
||||
float right = 25.2,
|
||||
float spaces = 5);
|
||||
|
||||
/**
|
||||
Sets margins from wxPageSetupDialogData.
|
||||
|
||||
@since 3.1.0
|
||||
*/
|
||||
void SetMargins(const wxPageSetupDialogData& pageSetupData);
|
||||
};
|
||||
|
||||
|
@@ -593,8 +593,13 @@ void wxHtmlPrintout::SetMargins(float top, float bottom, float left, float right
|
||||
m_MarginSpace = spaces;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void wxHtmlPrintout::SetMargins(const wxPageSetupDialogData& pageSetupData)
|
||||
{
|
||||
SetMargins(pageSetupData.GetMarginTopLeft().y,
|
||||
pageSetupData.GetMarginBottomRight().y,
|
||||
pageSetupData.GetMarginTopLeft().x,
|
||||
pageSetupData.GetMarginBottomRight().x);
|
||||
}
|
||||
|
||||
void wxHtmlPrintout::SetFonts(const wxString& normal_face, const wxString& fixed_face,
|
||||
const int *sizes)
|
||||
@@ -818,10 +823,7 @@ wxHtmlPrintout *wxHtmlEasyPrinting::CreatePrintout()
|
||||
p->SetFooter(m_Footers[0], wxPAGE_EVEN);
|
||||
p->SetFooter(m_Footers[1], wxPAGE_ODD);
|
||||
|
||||
p->SetMargins(m_PageSetupData->GetMarginTopLeft().y,
|
||||
m_PageSetupData->GetMarginBottomRight().y,
|
||||
m_PageSetupData->GetMarginTopLeft().x,
|
||||
m_PageSetupData->GetMarginBottomRight().x);
|
||||
p->SetMargins(*m_PageSetupData);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
Reference in New Issue
Block a user