]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docview.cpp
Fixed Fontdialog
[wxWidgets.git] / src / common / docview.cpp
index 36f36611c0d87c1f18cd7f03b1c73da0c8e53304..6f5aac75d989faa0d3fa610d527b1cc515c08fa0 100644 (file)
@@ -34,6 +34,9 @@
 #include "wx/menu.h"
 #include "wx/list.h"
 #include "wx/filedlg.h"
+#endif
+
+#ifdef __WXGTK__
 #include "wx/mdi.h"
 #endif
 
@@ -483,35 +486,7 @@ void wxView::OnChangeFilename(void)
     wxString name;
     GetDocument()->GetPrintableName(name);
 
-    // If the frame is an MDI child, just set the title to the name.
-    // Otherwise, append the document name to the name of the application
-    // I have to do an illegal cast because in wxGTK, wxMDIChildFrame
-    // doesn't inherited from wxFrame, Robert Roebling
-    
-    wxFrame *frame = NULL;
-    wxMDIChildFrame *mdi_frame = NULL;
-    if (GetFrame()->IsKindOf(CLASSINFO(wxMDIChildFrame)))
-      mdi_frame = (wxMDIChildFrame*)GetFrame();
-    else
-      frame = GetFrame();
-      
-    if (frame)
-    {
-      frame->SetTitle(name);
-      return;
-    }
-    
-    if (mdi_frame)
-    {
-      if (wxTheApp->GetAppName() != "")
-      {
-        char buf[400];
-        sprintf(buf, "%s - %s", (const char *)wxTheApp->GetAppName(), (const char *)name);
-        mdi_frame->SetTitle(buf);
-      }
-      else
-        mdi_frame->SetTitle(name);
-    }
+    GetFrame()->SetTitle(name);
   }
 }
 
@@ -1399,7 +1374,7 @@ bool wxDocChildFrame::OnClose(void)
 
 BEGIN_EVENT_TABLE(wxDocParentFrame, wxFrame)
     EVT_MENU(wxID_EXIT, wxDocParentFrame::OnExit)
-    EVT_MENU_RANGE(wxID_FILE1, wxID_FILE2, wxDocParentFrame::OnMRUFile)
+    EVT_MENU_RANGE(wxID_FILE1, wxID_FILE9, wxDocParentFrame::OnMRUFile)
 END_EVENT_TABLE()
 
 wxDocParentFrame::wxDocParentFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title,