X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/306b6fe972cccc5022a5ec6096cf94b6b1e0b1cb..2c3ebf8be5f192f23d8266603a72d19a7267c7c5:/wxPython/wx/tools/XRCed/xrced.py diff --git a/wxPython/wx/tools/XRCed/xrced.py b/wxPython/wx/tools/XRCed/xrced.py index fcc27120a7..ac593cb6e9 100644 --- a/wxPython/wx/tools/XRCed/xrced.py +++ b/wxPython/wx/tools/XRCed/xrced.py @@ -415,7 +415,7 @@ class Frame(wxFrame): xxx = tree.GetPyData(selected) wx.TheClipboard.Open() data = wx.CustomDataObject('XRCED') - data.SetData(cPickle.dumps(xxx.element)) + data.SetData(cPickle.dumps(xxx.element.toxml())) wx.TheClipboard.SetData(data) wx.TheClipboard.Close() self.SetStatusText('Copied') @@ -455,17 +455,20 @@ class Frame(wxFrame): return wx.TheClipboard.GetData(data) wx.TheClipboard.Close() - elem = cPickle.loads(data.GetData()) + xml = cPickle.loads(data.GetData()) # xml representation of element + elem = minidom.parseString(xml).childNodes[0] # Tempopary xxx object to test things xxx = MakeXXXFromDOM(parent, elem) - # Check compatibility error = False # Top-level x = xxx.treeObject() - if x.__class__ in [xxxDialog, xxxFrame, xxxMenuBar, xxxWizard]: + if x.__class__ in [xxxDialog, xxxFrame, xxxWizard]: # Top-level classes if parent.__class__ != xxxMainNode: error = True + elif x.__class__ == xxxMenuBar: + # Menubar can be put in frame or dialog + if parent.__class__ not in [xxxMainNode, xxxFrame, xxxDialog]: error = True elif x.__class__ == xxxToolBar: # Toolbar can be top-level of child of panel or frame if parent.__class__ not in [xxxMainNode, xxxPanel, xxxFrame] and \ @@ -576,7 +579,7 @@ class Frame(wxFrame): if evt.GetId() == wxID_CUT: wx.TheClipboard.Open() data = wx.CustomDataObject('XRCED') - data.SetData(cPickle.dumps(elem)) + data.SetData(cPickle.dumps(elem.toxml())) wx.TheClipboard.SetData(data) wx.TheClipboard.Close() tree.pendingHighLight = None