// Append a string to the end of the document without changing the selection.
void AppendTextRaw(const char* text);
-
+#ifdef SWIG
+ %pythoncode "_stc_utf8_methods.py"
+#endif
//----------------------------------------------------------------------
void AppendTextRaw(const char* text);
+#ifdef SWIG
+ %pythoncode "_stc_utf8_methods.py"
+#endif
//----------------------------------------------------------------------
// Append a string to the end of the document without changing the selection.
void AppendTextRaw(const char* text);
-
+#ifdef SWIG
+ %pythoncode "_stc_utf8_methods.py"
+#endif
//----------------------------------------------------------------------
void AppendTextRaw(const char* text);
+#ifdef SWIG
+ %pythoncode "_stc_utf8_methods.py"
+#endif
//----------------------------------------------------------------------
--- /dev/null
+
+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)
+
"""AppendTextRaw(self, char text)"""
return _stc.StyledTextCtrl_AppendTextRaw(*args, **kwargs)
+ # These functions are inserted as methods in to the Python StyleTextCtrl class
+
+
+
+ def AddTextUTF8(self, text):
+ """Add UTF8 encoded text to the document at the current position."""
+ 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."""
+ if not wx.USE_UNICODE:
+ u = text.decode('utf-8')
+ text = u.encode(wx.GetDefaultPyEncoding())
+ self.InsertTextRaw(pos, text)
+
+
+ def GetCurLineUTF8(self):
+ """
+ Retrieve the text of the line containing the caret, and also the
+ index of the caret on the line.
+ """
+ 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."""
+ 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."""
+ 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."""
+ 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 argument text."""
+ 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."""
+ 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 string to the end of the document without changing the selection."""
+ if not wx.USE_UNICODE:
+ u = text.decode('utf-8')
+ text = u.encode(wx.GetDefaultPyEncoding())
+ self.AppendTextRaw(text)
+
+
class StyledTextCtrlPtr(StyledTextCtrl):
def __init__(self, this):
2.6.0.0
-------
-wxGTK: wx.StaticText can wrap text if the width is set to an explicit
-value.
+wxMSW: Fixed wx.TransientPopupWindow (and therefore wx.TipWindow) to
+auto-dismiss when the mouse is clicked outside of the popup like it is
+supposed to.
+wxMSW: Fixed bug #1167891 wx.Notebook display problem with wx.NB_MULTILINE.
+
+wxMSW: Fixed bad cliping of hidden windows inside of wx.StaticBox.
+
+wxGTK: The configure flags for selecting GTK+ 1.2.x or 2.x has
+changed slightly. It is now --with-gtk[=VERSION] where VERSION is
+either '1', '2' or 'any'. The default is '2'.
+
+wx.stc.StyledTextCtrl: Added the following methods for alternate ways
+to set and fetch text from the document buffer. They work similarly
+to the existing methods of the same name, except that they don't go
+through the same string/unicode <--> wxString conversions. The "Raw"
+methods will do no conversions at all and in a unicode build of wxPython
+the strings will be in the utf-8 encoding and in an ansi build no
+assumption is made about the encoding. The "UTF8" functions will
+attempt to always get/set utf-8 text, which will always be true in a
+unicode build, and in an ansi build will also be true as long as the
+utf-8 used is compatible with the current encoding.
+
+ AddTextRaw AddTextUTF8
+ InsertTextRaw InsertTextUTF8
+ GetCurLineRaw GetCurLineUTF8
+ GetLineRaw GetLineUTF8
+ GetSelectedTextRaw GetSelectedTextUTF8
+ GetTextRangeRaw GetTextRangeUTF8
+ SetTextRaw SetTextUTF8
+ GetTextRaw GetTextUTF8
+ AppendTextRaw AppendTextUTF8
activating the cell editors to a EVT_CHAR event handler. This is done
so the character inserted into the editor will be the "cooked" char
value (including accented or composed keys) rather than the raw code
-provided by the EVT_KEY_DOWN event.
+provided by the EVT_KEY_DOWN event.
Added orient parameter to wx.MDIParentFrame.Tile()
wxMSW: wxTextCtrl with wx.TE_RICH2 style now uses RichEdit 4.1 if
-available.
+available.
Added GetCount, GetCountRGB, and GetCountColour methods to
-wx.ImageHistogram.
+wx.ImageHistogram.
wxMSW: wx.Window.Refresh changed to explicitly refresh all children as
well as the parent. Previously it was implicitly done because parents
wx.lib.mixins.listctrl: Patches from Toni Brkic:
* Bugfix for TextEditMixin when the view can't be scrolled
- * Enhancement for ListCtrlAutoWidthMixin, allowing it to manage
+ * Enhancement for ListCtrlAutoWidthMixin, allowing it to manage
the width of any column.
wxMac: removal and reusing toolbar tools like the other platforms is
list of top-level windows that currently exist in the application.
Updated docview library modules and sample apps from the ActiveGrid
-folks.
+folks.
Added the ActiveGrid IDE as a sample application.
out-of-sync assert is generated when clicking on a radio button and
then calling GetValue().
-Some XRC changes:
+Some XRC changes:
- Added 'icon' property to wxFrame and wxDialog
- No longer ignores menu bitmaps on non-MSW platforms
- Notebook page bitmaps are now supported
Added wx.EXEC_NODISABLE flag for wx.Execute, which will prevent all
the app's windows being disabled while a synchronous child process is
-running.
+running.
wxMSW: Much work to correct painting (or leaving transparent) of
control backgrounds, properly using background themes on XP, etc.
a temporary 'fix' until properly fixed before 2.6.
wxMac: Toolbar is now more native looking with borderless toolbar
-buttons.
+buttons.
wxMac: Switched wx.Bitmap to use newer Quartz object types and APIs
internally. This results in faster display and better alpha support.
Doc/View framework in pure Python code. See wx.lib.docview for the
base implementation and wx.lib.pydocview for Python-specific
extensions. There are also a couple sample applications located in
-samples/docview.
+samples/docview.
Added GetBitmap, GetIcon to wx.ImageList.
style=wx.BUFFER_VIRTUAL_AREA parameter.
wx.gizmos.TreeListCtrl: Add support for the EVT_TREE_ITEM_GETTOOLTIP
-event.
+event.
Added Resize, SetRGBRect, Size, and GetOrFindMaskColour methods to
-wx.Image.
+wx.Image.
Added wx.Rect.IsEmpty
enabled (does an enable itself)
Added wx.lib.ogl.DrawnShape, and fixed various little bugs in the new
-OGL.
+OGL.
Added support to XRC and XRCed for the 3-state checkbox flags and also
for wx.ToggleButton. Updated the generic window styles supported by
-XRCed.
+XRCed.
It is now possible to create "stock" buttons. Basically this means
that you only have to provide one of the stock IDs (and either an
button with "Cancel" as the label and if run on wxGTK2 then there will
also be an image of a red X::
- b = wx.Button(parent, wx.ID_CANCEL)
+ b = wx.Button(parent, wx.ID_CANCEL)
Added wx.lib.ticker.Ticker class from Chris Mellon.
- Removed FloatDCWrapper for conversion to ints and ints in
arguments
- Imported modules given leading underscore to name.
- - Added Cursor Line Tracking and User Point Labels.
+ - Added Cursor Line Tracking and User Point Labels.
- Demo for Cursor Line Tracking and Point Labels.
- Size of plot preview frame adjusted to show page better.
- Added helper functions PositionUserToScreen and
Applied patch from Pim Van Heuven that modifies 4 files:
- wxPython/demo/ListCtrl_edit.py (new demo)
- wxPython/demo/Main.py (include new demo in demo app)
- - wxPython/wx/lib/mixins/listctrl.py (several improvements to
+ - wxPython/wx/lib/mixins/listctrl.py (several improvements to
TextEditMixin)
- wxPython/wx/lib/wxpTag.py (some small fixes)
Added (thanks to Kevin Ollivier!) wrappers for wx.WebKitCtrl for the
OSX build. Other platforms will raise an exception if you try to use
-it.
+it.
wxPython on OSX can now be built in Unicode mode, can support multiple
version installs, and comes with an uninstaller script.
of property panels, since Reparent on wxMac is not implemented.
* Add support for wxTAB_TRAVERSAL to the XRC handler for
- wxScrolledWindow.
+ wxScrolledWindow.
* Add support for all wxListBox styles to the XRC handler for
- wxCheckListBox.
+ wxCheckListBox.
* Fix for wx.Listbook.DeleteAllPages to really delete everything.
have been reverted. The wx.DC methods are now compatible with the 2.4
implemetation. In addition a set of renamed methods have been added
that take wx.Point and/or wx.Size objects instead of individual
-parameters.
+parameters.
Added wx.lib.mixins.listctrl.TextEditMixin, a mixin class that allows
all columns of a wx.ListCtrl in report mode to be edited.
it.
Updated wx.lib.calendar with many fixes and enhancements from Joerg
-"Adi" Sieker.
+"Adi" Sieker.
Added wx.Display and wx.VideoMode.
What's new in 0.5.0
-------------------
-Changed the import semantics from ``"from wxPython import *"`` to
+Changed the import semantics from ``"from wxPython import *"`` to
``"from wxPython.wx import *"`` This is for people who are worried about
namespace pollution, they can use "from wxPython import wx" and then
prefix all the wxPython identifiers with "wx."
swig_sources = run_swig(['stc.i'], location, GENDIR, PKGDIR,
USE_SWIG, swig_force,
swig_args + ['-I'+STC_H, '-I'+location],
- [opj(STC_H, 'stc.h')] + swig_deps)
+ [opj(STC_H, 'stc.h'),
+ opj(location, "_stc_utf8_methods.py"),
+ ] + swig_deps)
ext = Extension('_stc',
swig_sources,