X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f37f49b652601744a8576d94568985cba49fc784..3dffc2aea2597a2df3c3faee052ca232635ab69d:/samples/docview/docview.cpp diff --git a/samples/docview/docview.cpp b/samples/docview/docview.cpp index b865b6f425..57eeef7c52 100644 --- a/samples/docview/docview.cpp +++ b/samples/docview/docview.cpp @@ -7,7 +7,7 @@ // RCS-ID: $Id$ // Copyright: (c) 1998 Julian Smart // (c) 2008 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /* @@ -181,7 +181,7 @@ bool MyApp::OnInit() // 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)); + CLASSINFO(ImageDocument), CLASSINFO(ImageView)); } // create the main frame window @@ -228,10 +228,9 @@ bool MyApp::OnInit() CreateMenuBarForFrame(frame, menuFile, m_menuEdit); frame->SetIcon(wxICON(doc)); - frame->Centre(wxBOTH); - frame->Show(true); + frame->Centre(); + frame->Show(); - SetTopWindow(frame); return true; } @@ -247,6 +246,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 ) { @@ -284,10 +284,11 @@ void MyApp::CreateMenuBarForFrame(wxFrame *frame, wxMenu *file, wxMenu *edit) frame->SetMenuBar(menubar); } -wxFrame *MyApp::CreateChildFrame(wxDocument *doc, wxView *view, bool isCanvas) +wxFrame *MyApp::CreateChildFrame(wxView *view, bool isCanvas) { // create a child frame of appropriate class for the current mode wxFrame *subframe; + wxDocument *doc = view->GetDocument(); #if wxUSE_MDI_ARCHITECTURE if ( GetMode() == Mode_MDI ) { @@ -316,7 +317,7 @@ wxFrame *MyApp::CreateChildFrame(wxDocument *doc, wxView *view, bool isCanvas) wxSize(300, 300) ); - subframe->Centre(wxBOTH); + subframe->Centre(); } wxMenu *menuFile = new wxMenu;