X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fa9b55dfba782b369c404f7bce9bee3d0c83c55f..3be6f59151607e392eda6ccd91ede065c4f43a8e:/samples/docview/docview.cpp diff --git a/samples/docview/docview.cpp b/samples/docview/docview.cpp index b3332a6f55..f8f2a8f98b 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(ImageDocument), CLASSINFO(ImageView)); } // 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); @@ -240,6 +247,7 @@ void MyApp::AppendDocumentFileCommands(wxMenu *menu, bool supportsPrinting) menu->Append(wxID_CLOSE); menu->Append(wxID_SAVE); menu->Append(wxID_SAVEAS); + menu->Append(wxID_REVERT, _("Re&vert...")); if ( supportsPrinting ) {