my unicode LoadFile/SaveFile changes were in the .in file this time.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23690
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// Load the contents of filename into the editor
bool LoadFile(const wxString& filename);
// Load the contents of filename into the editor
bool LoadFile(const wxString& filename);
+ // Allow for simulating a DnD DragOver
+ wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
+
+ // Allow for simulating a DnD DropText
+ bool DoDropText(long x, long y, const wxString& data);
+
+
//----------------------------------------------------------------------
//----------------------------------------------------------------------
bool success = file.Write(GetText(), *wxConvCurrent);
bool success = file.Write(GetText(), *wxConvCurrent);
#else
wxString buffer;
#endif
#else
wxString buffer;
#endif
off_t len = file.Length();
if (len > 0)
{
void *bufptr = buffer.GetWriteBuf(len);
success = (file.Read(bufptr, len) == len);
buffer.UngetWriteBuf(len);
off_t len = file.Length();
if (len > 0)
{
void *bufptr = buffer.GetWriteBuf(len);
success = (file.Read(bufptr, len) == len);
buffer.UngetWriteBuf(len);
contents = wxString(buffer, *wxConvCurrent);
#else
contents = buffer;
contents = wxString(buffer, *wxConvCurrent);
#else
contents = buffer;
+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);
+}
+
+
//----------------------------------------------------------------------
// Event handlers
//----------------------------------------------------------------------
// Event handlers
if (!file.IsOpened())
return FALSE;
if (!file.IsOpened())
return FALSE;
- bool success = file.Write(GetText());
+ bool success = file.Write(GetText(), *wxConvCurrent);
if (success)
SetSavePoint();
if (success)
SetSavePoint();
if (file.IsOpened())
{
wxString contents;
if (file.IsOpened())
{
wxString contents;
+#if wxUSE_UNICODE
+ wxMemoryBuffer buffer;
+#else
+ wxString buffer;
+#endif
off_t len = file.Length();
off_t len = file.Length();
- 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
}
else
success = true; // empty file is ok
+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);
+}
+
+
//----------------------------------------------------------------------
// Event handlers
//----------------------------------------------------------------------
// Event handlers
// Load the contents of filename into the editor
bool LoadFile(const wxString& filename);
// Load the contents of filename into the editor
bool LoadFile(const wxString& filename);
+ // Allow for simulating a DnD DragOver
+ wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
+
+ // Allow for simulating a DnD DropText
+ bool DoDropText(long x, long y, const wxString& data);
+
+
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Load the contents of filename into the editor
bool LoadFile(const wxString& filename);
// Load the contents of filename into the editor
bool LoadFile(const wxString& filename);
+ // Allow for simulating a DnD DragOver
+ wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
+
+ // Allow for simulating a DnD DropText
+ bool DoDropText(long x, long y, const wxString& data);
+
+
//----------------------------------------------------------------------
//----------------------------------------------------------------------
bool success = file.Write(GetText(), *wxConvCurrent);
bool success = file.Write(GetText(), *wxConvCurrent);
#else
wxString buffer;
#endif
#else
wxString buffer;
#endif
off_t len = file.Length();
if (len > 0)
{
void *bufptr = buffer.GetWriteBuf(len);
success = (file.Read(bufptr, len) == len);
buffer.UngetWriteBuf(len);
off_t len = file.Length();
if (len > 0)
{
void *bufptr = buffer.GetWriteBuf(len);
success = (file.Read(bufptr, len) == len);
buffer.UngetWriteBuf(len);
contents = wxString(buffer, *wxConvCurrent);
#else
contents = buffer;
contents = wxString(buffer, *wxConvCurrent);
#else
contents = buffer;
+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);
+}
+
+
//----------------------------------------------------------------------
// Event handlers
//----------------------------------------------------------------------
// Event handlers
if (!file.IsOpened())
return FALSE;
if (!file.IsOpened())
return FALSE;
- bool success = file.Write(GetText());
+ bool success = file.Write(GetText(), *wxConvCurrent);
if (success)
SetSavePoint();
if (success)
SetSavePoint();
if (file.IsOpened())
{
wxString contents;
if (file.IsOpened())
{
wxString contents;
+#if wxUSE_UNICODE
+ wxMemoryBuffer buffer;
+#else
+ wxString buffer;
+#endif
off_t len = file.Length();
off_t len = file.Length();
- 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
}
else
success = true; // empty file is ok
+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);
+}
+
+
//----------------------------------------------------------------------
// Event handlers
//----------------------------------------------------------------------
// Event handlers
// Load the contents of filename into the editor
bool LoadFile(const wxString& filename);
// Load the contents of filename into the editor
bool LoadFile(const wxString& filename);
+ // Allow for simulating a DnD DragOver
+ wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
+
+ // Allow for simulating a DnD DropText
+ bool DoDropText(long x, long y, const wxString& data);
+
+
//----------------------------------------------------------------------
//----------------------------------------------------------------------