]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/prntbase.cpp
Committing in .
[wxWidgets.git] / src / common / prntbase.cpp
index ce52bc53fd21da2a389966a763f4c3222cc646ba..6709e3721709b819f6fd60d842f167371e98446c 100644 (file)
@@ -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,11 @@ 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 +366,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;
     }
@@ -780,10 +783,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();
     }