- }
-
- //// Create a document manager
- m_docManager = new wxDocManager;
-
- //// Create a template relating drawing documents to their views
- (void) new wxDocTemplate(m_docManager, "Drawing", "*.drw", "", "drw", "Drawing Doc", "Drawing View",
- CLASSINFO(DrawingDocument), CLASSINFO(DrawingView));
-
- if (singleWindowMode)
- {
- // If we've only got one window, we only get to edit
- // one document at a time. Therefore no text editing, just
- // doodling.
- m_docManager->SetMaxDocsOpen(1);
- }
- else
- //// Create a template relating text documents to their views
- (void) new wxDocTemplate(m_docManager, "Text", "*.txt", "", "txt", "Text Doc", "Text View",
- CLASSINFO(TextEditDocument), CLASSINFO(TextEditView));
-
- //// Create the main frame window
- frame = new MyFrame(m_docManager, (wxFrame *) NULL, -1, "DocView Demo", wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE);
-
- //// Give it an icon (this is ignored in MDI mode: uses resources)
+
+ //// Create a document manager
+ m_docManager = new wxDocManager;
+
+ //// Create a template relating drawing documents to their views
+ new wxDocTemplate(m_docManager, wxT("Drawing"), wxT("*.drw"), wxT(""), wxT("drw"), wxT("Drawing Doc"), wxT("Drawing View"),
+ CLASSINFO(DrawingDocument), CLASSINFO(DrawingView));
+#ifdef __WXMAC__
+ wxFileName::MacRegisterDefaultTypeAndCreator( wxT("drw") , 'WXMB' , 'WXMA' ) ;
+#endif
+
+ if (singleWindowMode)
+ {
+ // If we've only got one window, we only get to edit
+ // one document at a time. Therefore no text editing, just
+ // doodling.
+ m_docManager->SetMaxDocsOpen(1);
+ }
+ else
+ {
+ //// Create a template relating text documents to their views
+ new wxDocTemplate(m_docManager, wxT("Text"), wxT("*.txt;*.text"), wxT(""), wxT("txt;text"), wxT("Text Doc"), wxT("Text View"),
+ CLASSINFO(TextEditDocument), CLASSINFO(TextEditView));
+#ifdef __WXMAC__
+ wxFileName::MacRegisterDefaultTypeAndCreator( wxT("txt") , 'TEXT' , 'WXMA' ) ;
+#endif
+ }
+
+ //// Create the main frame window
+ frame = new MyFrame(m_docManager, NULL, wxID_ANY, GetAppDisplayName(), wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE);
+
+ //// Give it an icon (this is ignored in MDI mode: uses resources)