#include "wx/menu.h"
#include "wx/list.h"
#include "wx/filedlg.h"
+#endif
+
+#ifdef __WXGTK__
#include "wx/mdi.h"
#endif
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);
}
}
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,