]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/docview/doc.cpp
removed style parameter from MSWCreateToolbar(), it is unneeded
[wxWidgets.git] / samples / docview / doc.cpp
index 864981f878bc8c693411af8d4e947e1812995000..7ce1d828e6419b166a25733b41492cbc431f437c 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     04/01/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart and Markus Holzem
-// Licence:    wxWindows license
+// Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
@@ -24,6 +24,9 @@
 #include "wx/wx.h"
 #endif
 #include "wx/txtstrm.h"
+#ifdef __WXMAC__
+#include "wx/filename.h"
+#endif
 
 #if !wxUSE_DOC_VIEW_ARCHITECTURE
 #error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h!
@@ -31,7 +34,6 @@
 
 #include "doc.h"
 #include "view.h"
-
 IMPLEMENT_DYNAMIC_CLASS(DrawingDocument, wxDocument)
 
 DrawingDocument::DrawingDocument(void)
@@ -44,7 +46,7 @@ DrawingDocument::~DrawingDocument(void)
 }
 
 #if wxUSE_STD_IOSTREAM
-ostream& DrawingDocument::SaveObject(ostream& stream)
+wxSTD ostream& DrawingDocument::SaveObject(wxSTD ostream& stream)
 {
     wxDocument::SaveObject(stream);
     
@@ -88,7 +90,7 @@ wxOutputStream& DrawingDocument::SaveObject(wxOutputStream& stream)
 #endif
 
 #if wxUSE_STD_IOSTREAM
-istream& DrawingDocument::LoadObject(istream& stream)
+wxSTD istream& DrawingDocument::LoadObject(wxSTD istream& stream)
 {
     wxDocument::LoadObject(stream);
     
@@ -153,7 +155,7 @@ DoodleSegment::~DoodleSegment(void)
 }
 
 #if wxUSE_STD_IOSTREAM
-ostream& DoodleSegment::SaveObject(ostream& stream)
+wxSTD ostream& DoodleSegment::SaveObject(wxSTD ostream& stream)
 {
     wxInt32 n = lines.Number();
     stream << n << '\n';
@@ -177,16 +179,16 @@ wxOutputStream &DoodleSegment::SaveObject(wxOutputStream& stream)
     wxTextOutputStream text_stream( stream );
     
     wxInt32 n = lines.Number();
-    text_stream << n << '\n';
+    text_stream << n << _T('\n');
     
     wxNode *node = lines.First();
     while (node)
     {
         DoodleLine *line = (DoodleLine *)node->Data();
-        text_stream << line->x1 << " " << 
-            line->y1 << " " << 
-            line->x2 << " " << 
-            line->y2 << "\n";
+        text_stream << line->x1 << _T(" ") << 
+            line->y1 << _T(" ") << 
+            line->x2 << _T(" ") << 
+            line->y2 << _T("\n");
         node = node->Next();
     }
     
@@ -195,7 +197,7 @@ wxOutputStream &DoodleSegment::SaveObject(wxOutputStream& stream)
 #endif
 
 #if wxUSE_STD_IOSTREAM
-istream& DoodleSegment::LoadObject(istream& stream)
+wxSTD istream& DoodleSegment::LoadObject(wxSTD istream& stream)
 {
     wxInt32 n = 0;
     stream >> n;
@@ -342,6 +344,10 @@ bool TextEditDocument::OnSaveDocument(const wxString& filename)
     if (!view->textsw->SaveFile(filename))
         return FALSE;
     Modify(FALSE);
+#ifdef __WXMAC__
+    wxFileName fn(filename) ;
+    fn.MacSetDefaultTypeAndCreator() ;
+#endif
     return TRUE;
 }