X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3996031094e28a6936ca1df2d289c9d3baecb27d..3e43d6143ba737da833e58b8f51eb400d374cb00:/samples/docview/docview.cpp diff --git a/samples/docview/docview.cpp b/samples/docview/docview.cpp index d8f9005801..f7312b2b30 100644 --- a/samples/docview/docview.cpp +++ b/samples/docview/docview.cpp @@ -40,6 +40,9 @@ #include "docview.h" #include "doc.h" #include "view.h" +#ifdef __WXMAC__ +#include "wx/filename.h" +#endif MyFrame *frame = (MyFrame *) NULL; @@ -74,6 +77,9 @@ bool MyApp::OnInit(void) //// Create a template relating drawing documents to their views (void) new wxDocTemplate(m_docManager, _T("Drawing"), _T("*.drw"), _T(""), _T("drw"), _T("Drawing Doc"), _T("Drawing View"), CLASSINFO(DrawingDocument), CLASSINFO(DrawingView)); +#ifdef __WXMAC__ + wxFileName::MacRegisterDefaultTypeAndCreator( "drw" , 'WXMB' , 'WXMA' ) ; +#endif if (singleWindowMode) { @@ -83,9 +89,14 @@ bool MyApp::OnInit(void) m_docManager->SetMaxDocsOpen(1); } else + { //// Create a template relating text documents to their views (void) new wxDocTemplate(m_docManager, _T("Text"), _T("*.txt"), _T(""), _T("txt"), _T("Text Doc"), _T("Text View"), CLASSINFO(TextEditDocument), CLASSINFO(TextEditView)); +#ifdef __WXMAC__ + wxFileName::MacRegisterDefaultTypeAndCreator( "txt" , 'TEXT' , 'WXMA' ) ; +#endif + } //// Create the main frame window frame = new MyFrame(m_docManager, (wxFrame *) NULL, -1, _T("DocView Demo"), wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE);