+#if wxUSE_TEXTCTRL
+bool wxStyledTextCtrl::DoSaveFile(const wxString& filename, int fileType)
+{
+ bool ok = wxTextAreaBase::DoSaveFile(filename, fileType);
+#else
+bool wxStyledTextCtrl::SaveFile(const wxString& filename)
+{
+#if wxUSE_FFILE
+ wxFFile file(filename, wxT("w"));
+ bool ok = file.IsOpened() && file.Write(GetValue(), *wxConvCurrent);
+#else
+ bool ok = false;
+#endif // wxUSE_FFILE
+#endif
+ if (ok)
+ {
+ SetSavePoint();
+ }
+ return ok;
+}
+
+#if wxUSE_TEXTCTRL
+bool wxStyledTextCtrl::DoLoadFile(const wxString& filename, int fileType)
+{
+ bool ok = wxTextAreaBase::DoLoadFile(filename, fileType);
+#else
+bool wxStyledTextCtrl::LoadFile(const wxString& filename)
+{
+#if wxUSE_FFILE
+ wxFFile file(filename);
+ bool ok = file.IsOpened();
+ if (ok)
+ {
+ wxString text;
+ ok = file.ReadAll(&text, *wxConvCurrent);
+ if (ok)
+ {
+ SetValue(text);
+ }
+ }
+#else
+ bool ok = false;
+#endif // wxUSE_FFILE
+#endif
+ if (ok)
+ {
+ EmptyUndoBuffer();
+ SetSavePoint();
+ }
+ return ok;
+}
+
+#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
+
+
+void wxStyledTextCtrl::SetUseAntiAliasing(bool useAA) {
+ m_swx->SetUseAntiAliasing(useAA);
+}
+
+bool wxStyledTextCtrl::GetUseAntiAliasing() {
+ return m_swx->GetUseAntiAliasing();
+}
+
+
+
+
+
+void wxStyledTextCtrl::AddTextRaw(const char* text, int length)
+{
+ if (length == -1)
+ length = strlen(text);
+ SendMsg(SCI_ADDTEXT, length, (sptr_t)text);
+}
+
+void wxStyledTextCtrl::InsertTextRaw(int pos, const char* text)
+{
+ SendMsg(SCI_INSERTTEXT, pos, (sptr_t)text);
+}
+
+wxCharBuffer wxStyledTextCtrl::GetCurLineRaw(int* linePos)
+{
+ int len = LineLength(GetCurrentLine());
+ if (!len) {
+ if (linePos) *linePos = 0;
+ wxCharBuffer empty;
+ return empty;
+ }
+
+ wxCharBuffer buf(len);
+ int pos = SendMsg(SCI_GETCURLINE, len, (sptr_t)buf.data());
+ if (linePos) *linePos = pos;
+ return buf;
+}
+
+wxCharBuffer wxStyledTextCtrl::GetLineRaw(int line)
+{
+ int len = LineLength(line);
+ if (!len) {
+ wxCharBuffer empty;
+ return empty;
+ }
+
+ wxCharBuffer buf(len);
+ SendMsg(SCI_GETLINE, line, (sptr_t)buf.data());
+ return buf;
+}
+
+wxCharBuffer wxStyledTextCtrl::GetSelectedTextRaw()
+{
+ long start;
+ long end;
+
+ GetSelection(&start, &end);
+ int len = end - start;
+ if (!len) {
+ wxCharBuffer empty;
+ return empty;
+ }
+
+ wxCharBuffer buf(len);
+ SendMsg(SCI_GETSELTEXT, 0, (sptr_t)buf.data());
+ return buf;
+}
+
+wxCharBuffer wxStyledTextCtrl::GetTextRangeRaw(int startPos, int endPos)
+{
+ if (endPos < startPos) {
+ int temp = startPos;
+ startPos = endPos;
+ endPos = temp;
+ }
+ int len = endPos - startPos;
+ if (!len) {
+ wxCharBuffer empty;
+ return empty;
+ }
+
+ wxCharBuffer buf(len);
+ TextRange tr;
+ tr.lpstrText = buf.data();
+ tr.chrg.cpMin = startPos;
+ tr.chrg.cpMax = endPos;
+ SendMsg(SCI_GETTEXTRANGE, 0, (sptr_t)&tr);
+ return buf;
+}
+
+void wxStyledTextCtrl::SetTextRaw(const char* text)
+{
+ SendMsg(SCI_SETTEXT, 0, (sptr_t)text);
+}
+
+wxCharBuffer wxStyledTextCtrl::GetTextRaw()
+{
+ int len = GetTextLength();
+ wxCharBuffer buf(len); // adds 1 for NUL automatically
+ SendMsg(SCI_GETTEXT, len + 1, (sptr_t)buf.data());
+ return buf;
+}
+
+void wxStyledTextCtrl::AppendTextRaw(const char* text, int length)
+{
+ if (length == -1)
+ length = strlen(text);
+ SendMsg(SCI_APPENDTEXT, length, (sptr_t)text);
+}
+
+
+
+