]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/docview/docview.cpp
Fix various gtk webkit warnings.
[wxWidgets.git] / samples / docview / docview.cpp
index b865b6f42590348df34d8b6659b1a6b493fca9ef..57eeef7c520d9f073ac62083c4eb2f60a6603aeb 100644 (file)
@@ -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;