X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/016f67baf6bf35c9d98279dcfee2da2764186de2..3d2d9036037d9ee51f47d878c3dcef4af4a6ef41:/wxPython/wx/tools/XRCed/tree.py diff --git a/wxPython/wx/tools/XRCed/tree.py b/wxPython/wx/tools/XRCed/tree.py index c3df6a0ee1..95fa519d1e 100644 --- a/wxPython/wx/tools/XRCed/tree.py +++ b/wxPython/wx/tools/XRCed/tree.py @@ -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')