- //// Find out if we're:
- //// SDI : multiple windows and documents but not MDI
- //// MDI : multiple windows and documents with containing frame - MSW only)
- /// single window : (one document at a time, only one frame, as in Windows Write)
- if (argc > 1)
- {
- if (strcmp(argv[1], "-single") == 0)
- {
- singleWindowMode = TRUE;
- }
- }
-
- //// 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, NULL, "DocView Demo", wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE);
-
- //// Give it an icon (this is ignored in MDI mode: uses resources)
-#ifdef __WINDOWS__
- frame->SetIcon(wxIcon("doc_icn"));
-#endif
-#ifdef __X__
- frame->SetIcon(wxIcon("aiai.xbm"));