Fixed print preview in printing sample (wxGTK).

Under wxGTK print preview is created on wxMemoryDC and hence wxGraphicsContext should be created also for this kind of wxDC in MyApp::Draw.

Closes #17489.
This commit is contained in:
Artur Wieczorek
2016-04-08 18:44:20 +02:00
parent e7b4c19e42
commit c991c659c4

View File

@@ -227,6 +227,10 @@ void MyApp::Draw(wxDC&dc)
if (window_dc) if (window_dc)
gc = wxGraphicsContext::Create( *window_dc ); gc = wxGraphicsContext::Create( *window_dc );
wxMemoryDC *memory_dc = wxDynamicCast( &dc, wxMemoryDC );
if (memory_dc)
gc = wxGraphicsContext::Create( *memory_dc );
#ifdef __WXMSW__ #ifdef __WXMSW__
wxEnhMetaFileDC *emf_dc = wxDynamicCast( &dc, wxEnhMetaFileDC ); wxEnhMetaFileDC *emf_dc = wxDynamicCast( &dc, wxEnhMetaFileDC );
if (emf_dc) if (emf_dc)