X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fa9b55dfba782b369c404f7bce9bee3d0c83c55f..77ea22ef1cd3cb0acd3d3f2943506c527a3002de:/samples/docview/docview.cpp diff --git a/samples/docview/docview.cpp b/samples/docview/docview.cpp index b3332a6f55..b865b6f425 100644 --- a/samples/docview/docview.cpp +++ b/samples/docview/docview.cpp @@ -148,6 +148,8 @@ bool MyApp::OnInit() if ( !wxApp::OnInit() ) return false; + ::wxInitAllImageHandlers(); + SetAppName("DocView Sample"); //// Create a document manager @@ -176,6 +178,10 @@ bool MyApp::OnInit() #if defined( __WXMAC__ ) && wxOSX_USE_CARBON wxFileName::MacRegisterDefaultTypeAndCreator("txt" , 'TEXT' , 'WXMA'); #endif + // Create a template relating image documents to their views + new wxDocTemplate(docManager, "Image", "*.png;*.jpg", "", "png;jpg", + "Image Doc", "Image View", + CLASSINFO(wxImageDocument), CLASSINFO(wxImageView)); } // create the main frame window @@ -216,6 +222,7 @@ bool MyApp::OnInit() { m_canvas = new MyCanvas(NULL, frame); m_menuEdit = CreateDrawingEditMenu(); + docManager->CreateNewDocument(); } CreateMenuBarForFrame(frame, menuFile, m_menuEdit);