Allow overriding print preview frame creation in docview.
Add a virtual wxDocManager::CreatePreviewFrame() which can be overridden to customize the print preview used by docview framework. Closes #11390. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1114,6 +1114,15 @@ void wxDocManager::OnPrint(wxCommandEvent& WXUNUSED(event))
|
||||
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||
}
|
||||
|
||||
#if wxUSE_PRINTING_ARCHITECTURE
|
||||
wxPreviewFrame* wxDocManager::CreatePreviewFrame(wxPrintPreviewBase* preview,
|
||||
wxWindow *parent,
|
||||
const wxString& title)
|
||||
{
|
||||
return new wxPreviewFrame(preview, parent, title);
|
||||
}
|
||||
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
#if wxUSE_PRINTING_ARCHITECTURE
|
||||
@@ -1135,9 +1144,11 @@ void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event))
|
||||
return;
|
||||
}
|
||||
|
||||
wxPreviewFrame *
|
||||
frame = new wxPreviewFrame(preview, wxTheApp->GetTopWindow(),
|
||||
_("Print Preview"));
|
||||
wxPreviewFrame* frame = CreatePreviewFrame(preview,
|
||||
wxTheApp->GetTopWindow(),
|
||||
_("Print Preview"));
|
||||
wxCHECK_RET( frame, "should create a print preview frame" );
|
||||
|
||||
frame->Centre(wxBOTH);
|
||||
frame->Initialize();
|
||||
frame->Show(true);
|
||||
|
Reference in New Issue
Block a user