-------

Using wx.GetDefaultPyEncoding/wx.SetDefaultPyEncoding for changing active encoding.

Fixed pasting siblings (Ctrl key pressed while pasting).

Dealed with ascii build (Python does not recognize 'ascii' as valid encoding).
If encoding is not specified it is not written in XRC. Will add more
customization in the future.

Changed to use SimpleTool instead or Toggle tool (does not work on Win32).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34344 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Roman Rolinsky
2005-05-26 01:10:05 +00:00
parent 628eae0bcd
commit 9a69d0aa1d
7 changed files with 32 additions and 134 deletions

View File

@@ -19,7 +19,10 @@ class MemoryFile:
self.name = name
self.buffer = ''
def write(self, data):
self.buffer += data.encode(g.currentEncoding)
if g.currentEncoding:
self.buffer += data.encode(g.currentEncoding)
else:
self.buffer += data.encode()
def close(self):
wxMemoryFSHandler_AddFile(self.name, self.buffer)
@@ -355,6 +358,8 @@ class HighLightBox:
def Remove(self):
map(wxWindow.Destroy, self.lines)
g.testWin.highLight = None
def Refresh(self):
map(wxWindow.Refresh, self.lines)
################################################################################
@@ -648,6 +653,7 @@ class XML_Tree(wxTreeCtrl):
g.testWin.highLight.Replace(pos, size)
else:
g.testWin.highLight = HighLightBox(pos, size)
g.testWin.highLight.Refresh()
g.testWin.highLight.item = item
def ShowTestWindow(self, item):
@@ -769,7 +775,7 @@ class XML_Tree(wxTreeCtrl):
memFile.close() # write to wxMemoryFS
xmlFlags = wxXRC_NO_SUBCLASSING
# Use translations if encoding is not specified
if g.currentEncoding == 'ascii':
if not g.currentEncoding:
xmlFlags != wxXRC_USE_LOCALE
res = wxXmlResource('', xmlFlags)
res.Load('memory:xxx.xrc')