X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9746a2ba50fdfa914e0476cb31710f9ccb5cc3cc..66bd6b93005b803910caca469110495ce549599f:/src/common/docview.cpp diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 36f36611c0..6f5aac75d9 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -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,