X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6adaedf0fc6607ee5bb4e86358396e5e07c6649f..399b60a0ad232265cd74ce8bf6a53a1f2cc57ff2:/src/common/prntbase.cpp diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp index ce52bc53fd..03182d5c25 100644 --- a/src/common/prntbase.cpp +++ b/src/common/prntbase.cpp @@ -55,7 +55,6 @@ #endif #endif // __WXMSW__ -#if !USE_SHARED_LIBRARY IMPLEMENT_CLASS(wxPrinterBase, wxObject) IMPLEMENT_ABSTRACT_CLASS(wxPrintout, wxObject) IMPLEMENT_CLASS(wxPreviewCanvas, wxWindow) @@ -71,7 +70,6 @@ BEGIN_EVENT_TABLE(wxPreviewCanvas, wxScrolledWindow) EVT_PAINT(wxPreviewCanvas::OnPaint) EVT_SYS_COLOUR_CHANGED(wxPreviewCanvas::OnSysColourChanged) END_EVENT_TABLE() -#endif /* * Printer @@ -197,6 +195,13 @@ void wxPreviewCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) wxPaintDC dc(this); PrepareDC( dc ); +/* +#ifdef __WXGTK__ + if (!GetUpdateRegion().IsEmpty()) + dc.SetClippingRegion( GetUpdateRegion() ); +#endif +*/ + if (m_printPreview) { m_printPreview->PaintPage(this, dc); @@ -363,14 +368,14 @@ void wxPreviewControlBar::CreateButtons() if (m_buttonFlags & wxPREVIEW_PREVIOUS) { - m_previousPageButton = new wxButton(this, wxID_PREVIEW_PREVIOUS, "<<", wxPoint(x, y), + m_previousPageButton = new wxButton(this, wxID_PREVIEW_PREVIOUS, wxT("<<"), wxPoint(x, y), wxSize(buttonWidth, buttonHeight)); x += gap + buttonWidth; } if (m_buttonFlags & wxPREVIEW_NEXT) { - m_nextPageButton = new wxButton(this, wxID_PREVIEW_NEXT, ">>", + m_nextPageButton = new wxButton(this, wxID_PREVIEW_NEXT, wxT(">>"), wxPoint(x, y), wxSize(buttonWidth, buttonHeight)); x += gap + buttonWidth; } @@ -652,8 +657,10 @@ bool wxPrintPreviewBase::RenderPage(int pageNum) if (!m_previewCanvas) { - wxMessageBox(_("wxPrintPreviewBase::RenderPage: must use wxPrintPreviewBase::SetCanvas to let me know about the canvas!"), - _("Print Preview Failure"), wxOK); + wxFAIL_MSG(_T("wxPrintPreviewBase::RenderPage: must use " + "wxPrintPreviewBase::SetCanvas to let me " + "know about the canvas!")); + return FALSE; } m_previewCanvas->GetSize(&canvasWidth, &canvasHeight); @@ -780,10 +787,10 @@ void wxPrintPreviewBase::SetZoom(int percent) m_previewBitmap = NULL; } - if (m_previewCanvas) { RenderPage(m_currentPage); + ((wxScrolledWindow *) m_previewCanvas)->Scroll(0, 0); m_previewCanvas->Clear(); m_previewCanvas->Refresh(); }