# Top-level sizer? return window's sizer
if xxx.isSizer and isinstance(parentWin, wxWindow):
return parentWin.GetSizer()
- elif isinstance(xxx, xxxStatusBar): return None
- elif isinstance(xxx, xxxToolBar):
- # If it's the main toolbar, we can't really select it
+ elif xxx.__class__ in [xxxStatusBar, xxxMenu, xxxMenuItem, xxxSeparator]: return None
+ elif xxx.__class__ in [xxxToolBar, xxxMenuBar]:
+ # If it's the main toolbar or menubar, we can't really select it
if xxx.parent.__class__ == xxxFrame: return None
elif isinstance(xxx.parent, xxxToolBar):
# Select complete toolbar
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 \
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