From: Roman Rolinsky Date: Wed, 5 Apr 2006 14:55:17 +0000 (+0000) Subject: Second fix for Copy/Paste (using expat.native_encoding property). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/28e65e0fa03994a63645cf91a76ee8080beefa66 Second fix for Copy/Paste (using expat.native_encoding property). Added cellpos,cellspan properties for Spacer in GridBag sizer. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38572 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/wx/tools/XRCed/CHANGES.txt b/wxPython/wx/tools/XRCed/CHANGES.txt index eb90262a21..8f27643994 100644 --- a/wxPython/wx/tools/XRCed/CHANGES.txt +++ b/wxPython/wx/tools/XRCed/CHANGES.txt @@ -1,3 +1,9 @@ +0.1.7-4 +------- + +Second fix for Copy/Paste (using expat.native_encoding property). +Added cellpos,cellspan properties for Spacer in GridBag sizer. + 0.1.7-3 ------- diff --git a/wxPython/wx/tools/XRCed/globals.py b/wxPython/wx/tools/XRCed/globals.py index aa40525283..e731674e41 100644 --- a/wxPython/wx/tools/XRCed/globals.py +++ b/wxPython/wx/tools/XRCed/globals.py @@ -15,7 +15,7 @@ import sys # Global constants progname = 'XRCed' -version = '0.1.7-3' +version = '0.1.7-4' # Minimal wxWindows version MinWxVersion = (2,6,0) if wxVERSION[:3] < MinWxVersion: diff --git a/wxPython/wx/tools/XRCed/xrced.py b/wxPython/wx/tools/XRCed/xrced.py index 461a72dbd4..9da4ce74fe 100644 --- a/wxPython/wx/tools/XRCed/xrced.py +++ b/wxPython/wx/tools/XRCed/xrced.py @@ -22,6 +22,7 @@ Options: from globals import * import os, sys, getopt, re, traceback, tempfile, shutil, cPickle +from xml.parsers import expat # Local modules from tree import * # imports xxx which imports params @@ -418,8 +419,7 @@ class Frame(wxFrame): data = wx.CustomDataObject('XRCED') # Set encoding in header # (False,True) - s = (xxx.element.toxml(encoding=g.currentEncoding), - xxx.element.toxml())[not g.currentEncoding] + s = xxx.element.toxml(encoding=expat.native_encoding) data.SetData(cPickle.dumps(s)) wx.TheClipboard.SetData(data) wx.TheClipboard.Close() @@ -593,8 +593,7 @@ class Frame(wxFrame): if wx.TheClipboard.Open(): data = wx.CustomDataObject('XRCED') # (False, True) - s = (elem.toxml(encoding=g.currentEncoding), - elem.toxml())[not g.currentEncoding] + s = elem.toxml(encoding=expat.native_encoding) data.SetData(cPickle.dumps(s)) wx.TheClipboard.SetData(data) wx.TheClipboard.Close() diff --git a/wxPython/wx/tools/XRCed/xxx.py b/wxPython/wx/tools/XRCed/xxx.py index 92df22cfe6..fa6ea642e3 100644 --- a/wxPython/wx/tools/XRCed/xxx.py +++ b/wxPython/wx/tools/XRCed/xxx.py @@ -874,6 +874,11 @@ class xxxSpacer(xxxObject): allParams = ['size', 'option', 'flag', 'border'] paramDict = {'option': ParamInt} default = {'size': '0,0'} + def __init__(self, parent, element, refElem=None): + # For GridBag sizer items, extra parameters added + if isinstance(parent, xxxGridBagSizer): + self.allParams = self.allParams + ['cellpos', 'cellspan'] + xxxObject.__init__(self, parent, element, refElem) class xxxMenuBar(xxxContainer): allParams = ['style']