]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/prntbase.cpp
1945421 applied
[wxWidgets.git] / src / common / prntbase.cpp
index 25bbd8ae09f0b085d43199a83a5206b4054db1fe..6e98cfadac79fff34cab5e628a6e0776c6494247 100644 (file)
 
 #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
 #include "wx/msw/printdlg.h"
+#include "wx/msw/dcprint.h"
 #elif defined(__WXMAC__)
 #include "wx/mac/printdlg.h"
 #include "wx/mac/private/print.h"
+#include "wx/mac/dcprint.h"
+#elif defined(__WXPM__)
+#include "wx/os2/dcprint.h"
+#include "wx/generic/prntdlgg.h"
 #else
 #include "wx/generic/prntdlgg.h"
 #include "wx/dcps.h"
@@ -205,14 +210,12 @@ wxDialog *wxNativePrintFactory::CreatePrintSetupDialog( wxWindow *parent,
 #endif
 }
 
-wxDC* wxNativePrintFactory::CreatePrinterDC( const wxPrintData& data )
+wxDCImpl* wxNativePrintFactory::CreatePrinterDCImpl( wxPrinterDC *owner, const wxPrintData& data )
 {
-#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
-    return new wxPrinterDC(data);
-#elif defined(__WXMAC__)
-    return new wxPrinterDC(data);
+#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXUNIVERSAL__)
+    return new wxPostScriptDCImpl( owner, data );
 #else
-    return new wxPostScriptDC(data);
+    return new wxPrinterDCImpl( owner, data );
 #endif
 }
 
@@ -878,20 +881,14 @@ void wxPreviewCanvas::OnSysColourChanged(wxSysColourChangedEvent& event)
 void wxPreviewCanvas::OnChar(wxKeyEvent &event)
 {
     wxPreviewControlBar* controlBar = ((wxPreviewFrame*) GetParent())->GetControlBar();
-    if (event.GetKeyCode() == WXK_ESCAPE)
+    switch (event.GetKeyCode())
     {
-        ((wxPreviewFrame*) GetParent())->Close(true);
-        return;
-    }
-    else if (event.GetKeyCode() == WXK_TAB)
-    {
-        controlBar->OnGoto();
-        return;
-    }
-    else if (event.GetKeyCode() == WXK_RETURN)
-    {
-        controlBar->OnPrint();
-        return;
+        case WXK_TAB:
+            controlBar->OnGoto();
+            return;
+        case WXK_RETURN:
+            controlBar->OnPrint();
+            return;
     }
 
     if (!event.ControlDown())
@@ -1224,9 +1221,22 @@ int wxPreviewControlBar::GetZoomControl()
 IMPLEMENT_CLASS(wxPreviewFrame, wxFrame)
 
 BEGIN_EVENT_TABLE(wxPreviewFrame, wxFrame)
+    EVT_CHAR_HOOK(wxPreviewFrame::OnChar)
     EVT_CLOSE(wxPreviewFrame::OnCloseWindow)
 END_EVENT_TABLE()
 
+void wxPreviewFrame::OnChar(wxKeyEvent &event)
+{
+    if ( event.GetKeyCode() == WXK_ESCAPE )
+    {
+        Close(true);
+    }
+    else
+    {
+        event.Skip();
+    }
+}
+
 wxPreviewFrame::wxPreviewFrame(wxPrintPreviewBase *preview, wxWindow *parent, const wxString& title,
                                const wxPoint& pos, const wxSize& size, long style, const wxString& name):
 wxFrame(parent, wxID_ANY, title, pos, size, style, name)