X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3996031094e28a6936ca1df2d289c9d3baecb27d..cffadd8447201d0e2e1b3de6f8a24b967da9140c:/samples/docview/docview.cpp diff --git a/samples/docview/docview.cpp b/samples/docview/docview.cpp index d8f9005801..e68dd48d7c 100644 --- a/samples/docview/docview.cpp +++ b/samples/docview/docview.cpp @@ -5,7 +5,7 @@ // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem +// Copyright: (c) Julian Smart // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// @@ -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"), + (void) new wxDocTemplate(m_docManager, _T("Text"), _T("*.txt;*.text"), _T(""), _T("txt;text"), _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); @@ -258,7 +269,7 @@ MyCanvas *MyFrame::CreateCanvas(wxView *view, wxFrame *parent) // Give it scrollbars canvas->SetScrollbars(20, 20, 50, 50); canvas->SetBackgroundColour(*wxWHITE); - canvas->Clear(); + canvas->ClearBackground(); return canvas; }