- undo/redo fixes for moving and cut/paste;
- compatibility check for non-container controls git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46018 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -725,6 +725,8 @@ class Frame(wx.Frame):
|
||||
# Toolbar can be top-level of child of panel or frame
|
||||
if parent.__class__ not in [xxxMainNode, xxxPanel, xxxFrame] and \
|
||||
not parent.isSizer: error = True
|
||||
elif not parent.hasChildren:
|
||||
error = True
|
||||
elif child.__class__ == xxxPanel and parent.__class__ == xxxMainNode:
|
||||
pass
|
||||
elif child.__class__ == xxxSpacer:
|
||||
@@ -835,12 +837,16 @@ class Frame(wx.Frame):
|
||||
|
||||
if g.testWin and g.testWin.highLight:
|
||||
g.testWin.highLight.Remove()
|
||||
tree.needUpdate = True
|
||||
tree.needUpdate = True
|
||||
|
||||
# Undo info
|
||||
self.lastOp = 'MOVELEFT'
|
||||
status = 'Made next sibling of parent'
|
||||
|
||||
# Prepare undo data
|
||||
panel.Apply()
|
||||
tree.UnselectAll()
|
||||
|
||||
oldIndex = tree.ItemIndex(selected)
|
||||
elem = tree.RemoveLeaf(selected)
|
||||
nextItem = tree.GetFirstChild(pparent)[0]
|
||||
@@ -901,7 +907,11 @@ class Frame(wx.Frame):
|
||||
# Remove highlight, update testWin
|
||||
if g.testWin and g.testWin.highLight:
|
||||
g.testWin.highLight.Remove()
|
||||
tree.needUpdate = True
|
||||
tree.needUpdate = True
|
||||
|
||||
# Prepare undo data
|
||||
panel.Apply()
|
||||
tree.UnselectAll()
|
||||
|
||||
# Undo info
|
||||
self.lastOp = 'MOVERIGHT'
|
||||
@@ -939,6 +949,7 @@ class Frame(wx.Frame):
|
||||
selected = tree.InsertNode(newParent, tree.GetPyData(newParent).treeObject(), elem, wx.TreeItemId())
|
||||
|
||||
newIndex = tree.ItemIndex(selected)
|
||||
tree.Expand(selected)
|
||||
tree.SelectItem(selected)
|
||||
|
||||
undoMan.RegisterUndo(UndoMove(oldParent, oldIndex, newParent, newIndex))
|
||||
|
Reference in New Issue
Block a user