]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stc/stc.cpp.in
mention ShouldInheritColours() change
[wxWidgets.git] / src / stc / stc.cpp.in
index be24cc98f7a5bc1b6125ec2eb4fb612176a8669e..2b531a6f5416163d3d721017ba98d72068ad3d64 100644 (file)
@@ -320,7 +320,7 @@ bool wxStyledTextCtrl::SaveFile(const wxString& filename)
     if (!file.IsOpened())
         return FALSE;
 
-    bool success = file.Write(GetText());
+    bool success = file.Write(GetText(), *wxConvCurrent);
 
     if (success)
         SetSavePoint();
@@ -336,13 +336,22 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
     if (file.IsOpened())
     {
         wxString contents;
+#if wxUSE_UNICODE
+        wxMemoryBuffer buffer;
+#else
+        wxString buffer;
+#endif
         off_t len = file.Length();
-
         if (len > 0)
         {
-            wxChar *buf = contents.GetWriteBuf(len);
-            success = (file.Read(buf, len) == len);
-            contents.UngetWriteBuf();
+            void *bufptr = buffer.GetWriteBuf(len);
+            success = (file.Read(bufptr, len) == len);
+            buffer.UngetWriteBuf(len);
+#if wxUSE_UNICODE
+            contents = wxString(buffer, *wxConvCurrent);
+#else
+            contents = buffer;
+#endif
         }
         else
             success = true;            // empty file is ok
@@ -359,6 +368,18 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
 }
 
 
+#if wxUSE_DRAG_AND_DROP
+wxDragResult wxStyledTextCtrl::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) { 
+        return m_swx->DoDragOver(x, y, def); 
+} 
+
+
+bool wxStyledTextCtrl::DoDropText(long x, long y, const wxString& data) { 
+    return m_swx->DoDropText(x, y, data);
+}
+#endif
+
+
 //----------------------------------------------------------------------
 // Event handlers