+ def AddTextRaw(*args, **kwargs):
+ """
+ AddTextRaw(self, char text)
+
+ Add text to the document at current position. The text should be
+ utf-8 encoded on unicode builds of wxPython, or can be any 8-bit text
+ in ansi builds.
+ """
+ return _stc.StyledTextCtrl_AddTextRaw(*args, **kwargs)
+
+ def InsertTextRaw(*args, **kwargs):
+ """
+ InsertTextRaw(self, int pos, char text)
+
+ Insert string at a position. The text should be utf-8 encoded on
+ unicode builds of wxPython, or can be any 8-bit text in ansi builds.
+ """
+ return _stc.StyledTextCtrl_InsertTextRaw(*args, **kwargs)
+
+ def GetCurLineRaw(*args, **kwargs):
+ """
+ GetCurLineRaw() -> (text, index)
+
+ Retrieve the text of the line containing the caret, and also the index
+ of the caret on the line. The returned value is a utf-8 encoded
+ string in unicode builds of wxPython, or raw 8-bit text otherwise.
+ """
+ return _stc.StyledTextCtrl_GetCurLineRaw(*args, **kwargs)
+
+ def GetLineRaw(*args, **kwargs):
+ """
+ GetLineRaw(self, int line) -> wxCharBuffer
+
+ Retrieve the contents of a line. The returned value is a utf-8
+ encoded string in unicode builds of wxPython, or raw 8-bit text
+ otherwise.
+ """
+ return _stc.StyledTextCtrl_GetLineRaw(*args, **kwargs)
+
+ def GetSelectedTextRaw(*args, **kwargs):
+ """
+ GetSelectedTextRaw(self) -> wxCharBuffer
+
+ Retrieve the selected text. The returned value is a utf-8 encoded
+ string in unicode builds of wxPython, or raw 8-bit text otherwise.
+ """
+ return _stc.StyledTextCtrl_GetSelectedTextRaw(*args, **kwargs)
+
+ def GetTextRangeRaw(*args, **kwargs):
+ """
+ GetTextRangeRaw(self, int startPos, int endPos) -> wxCharBuffer
+
+ Retrieve a range of text. The returned value is a utf-8 encoded
+ string in unicode builds of wxPython, or raw 8-bit text otherwise.
+ """
+ return _stc.StyledTextCtrl_GetTextRangeRaw(*args, **kwargs)
+
+ def SetTextRaw(*args, **kwargs):
+ """
+ SetTextRaw(self, char text)
+
+ Replace the contents of the document with the argument text. The text
+ should be utf-8 encoded on unicode builds of wxPython, or can be any
+ 8-bit text in ansi builds.
+ """
+ return _stc.StyledTextCtrl_SetTextRaw(*args, **kwargs)
+
+ def GetTextRaw(*args, **kwargs):
+ """
+ GetTextRaw(self) -> wxCharBuffer
+
+ Retrieve all the text in the document. The returned value is a utf-8
+ encoded string in unicode builds of wxPython, or raw 8-bit text
+ otherwise.
+ """
+ return _stc.StyledTextCtrl_GetTextRaw(*args, **kwargs)
+
+ def AppendTextRaw(*args, **kwargs):
+ """
+ AppendTextRaw(self, char text)
+
+ Append a string to the end of the document without changing the
+ selection. The text should be utf-8 encoded on unicode builds of
+ wxPython, or can be any 8-bit text in ansi builds.
+ """
+ return _stc.StyledTextCtrl_AppendTextRaw(*args, **kwargs)
+
+ def AddTextUTF8(self, text):
+ """
+ Add UTF8 encoded text to the document at the current position.
+ Works 'natively' in a unicode build of wxPython, and will also work
+ in an ansi build if the UTF8 text is compatible with the current
+ encoding.
+ """
+ if not wx.USE_UNICODE:
+ u = text.decode('utf-8')
+ text = u.encode(wx.GetDefaultPyEncoding())
+ self.AddTextRaw(text)
+
+
+ def InsertTextUTF8(self, pos, text):
+ """
+ Insert UTF8 encoded text at a position. Works 'natively' in a
+ unicode build of wxPython, and will also work in an ansi build if
+ the UTF8 text is compatible with the current encoding.
+ """
+ if not wx.USE_UNICODE:
+ u = text.decode('utf-8')
+ text = u.encode(wx.GetDefaultPyEncoding())
+ self.InsertTextRaw(pos, text)
+
+
+ def GetCurLineUTF8(self):
+ """
+ Retrieve the UTF8 text of the line containing the caret, and also
+ the index of the caret on the line. In an ansi build of wxPython
+ the text retrieved from the document is assumed to be in the
+ current default encoding.
+ """
+ text, pos = self.GetCurLineRaw()
+ if not wx.USE_UNICODE:
+ u = text.decode(wx.GetDefaultPyEncoding())
+ text = u.encode('utf-8')
+ return text, pos
+
+
+ def GetLineUTF8(self, line):
+ """
+ Retrieve the contents of a line as UTF8. In an ansi build of wxPython
+ the text retrieved from the document is assumed to be in the
+ current default encoding.
+ """
+ text = self.GetLineRaw(line)
+ if not wx.USE_UNICODE:
+ u = text.decode(wx.GetDefaultPyEncoding())
+ text = u.encode('utf-8')
+ return text
+
+
+ def GetSelectedTextUTF8(self):
+ """
+ Retrieve the selected text as UTF8. In an ansi build of wxPython
+ the text retrieved from the document is assumed to be in the
+ current default encoding.
+ """
+ text = self.GetSelectedTextRaw()
+ if not wx.USE_UNICODE:
+ u = text.decode(wx.GetDefaultPyEncoding())
+ text = u.encode('utf-8')
+ return text
+
+
+ def GetTextRangeUTF8(self, startPos, endPos):
+ """
+ Retrieve a range of text as UTF8. In an ansi build of wxPython
+ the text retrieved from the document is assumed to be in the
+ current default encoding.
+ """
+ text = self.GetTextRangeRaw(startPos, endPos)
+ if not wx.USE_UNICODE:
+ u = text.decode(wx.GetDefaultPyEncoding())
+ text = u.encode('utf-8')
+ return text
+
+
+ def SetTextUTF8(self, text):
+ """
+ Replace the contents of the document with the UTF8 text given.
+ Works 'natively' in a unicode build of wxPython, and will also
+ work in an ansi build if the UTF8 text is compatible with the
+ current encoding.
+ """
+ if not wx.USE_UNICODE:
+ u = text.decode('utf-8')
+ text = u.encode(wx.GetDefaultPyEncoding())
+ self.SetTextRaw(text)
+
+
+ def GetTextUTF8(self):
+ """
+ Retrieve all the text in the document as UTF8. In an ansi build
+ of wxPython the text retrieved from the document is assumed to be
+ in the current default encoding.
+ """
+ text = self.GetTextRaw()
+ if not wx.USE_UNICODE:
+ u = text.decode(wx.GetDefaultPyEncoding())
+ text = u.encode('utf-8')
+ return text
+
+
+ def AppendTextUTF8(self, text):
+ """
+ Append a UTF8 string to the end of the document without changing
+ the selection. Works 'natively' in a unicode build of wxPython,
+ and will also work in an ansi build if the UTF8 text is compatible
+ with the current encoding.
+ """
+ if not wx.USE_UNICODE:
+ u = text.decode('utf-8')
+ text = u.encode(wx.GetDefaultPyEncoding())
+ self.AppendTextRaw(text)
+
+