]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/printing/printing.cpp
Removed dummy wxFont == operator implementation (IIRC was needed to compile with...
[wxWidgets.git] / samples / printing / printing.cpp
index e0a29dc9dd80cd37757433dae07bf27accbc0271..0b4c31acccc4cfaf8ad22f6d24947be3e435df37 100644 (file)
@@ -412,7 +412,16 @@ void MyFrame::Draw(wxDC& dc)
         dc.DrawBitmap( m_bitmap, 10, 10 );
 
 #if wxUSE_GRAPHICS_CONTEXT
-    wxGraphicsContext *gc = dc.CreateGraphicsContext();
+    wxGraphicsContext *gc = NULL;
+
+    wxPrinterDC *printer_dc = wxDynamicCast( &dc, wxPrinterDC );
+    if (printer_dc)
+        gc = wxGraphicsContext::Create( *printer_dc );
+
+    wxWindowDC *window_dc = wxDynamicCast( &dc, wxWindowDC );
+    if (window_dc)
+        gc = wxGraphicsContext::Create( *window_dc );
+   
     if (gc)
     {
         // make a path that contains a circle and some lines, centered at 100,100