]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/printing/printing.cpp
added a period at the end of a sentence (test commit, really)
[wxWidgets.git] / samples / printing / printing.cpp
index e0a29dc9dd80cd37757433dae07bf27accbc0271..c41b5cfe95832538f52d17623c4dfa44b7731e60 100644 (file)
@@ -80,7 +80,7 @@ bool MyApp::OnInit(void)
 
     wxInitAllImageHandlers();
 
-    m_testFont.Create(10, wxSWISS, wxNORMAL, wxNORMAL);
+    m_testFont.Create(10, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
 
     g_printData = new wxPrintData;
     // You could set an initial paper size here
@@ -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