X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/abee7f4704abec585496b874eb87f5cd5fef45b8..fdb97de42b8a1491257566fb7bbd343916f1f2b8:/samples/docview/docview.cpp?ds=sidebyside diff --git a/samples/docview/docview.cpp b/samples/docview/docview.cpp index 5e0c865bae..e0ee83cbd2 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 @@ -241,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 ) {