index = tree.ItemIndex(selected)
if index == 0: return # No previous sibling found
+ # Remove highlight, update testWin
+ if g.testWin.highLight:
+ g.testWin.highLight.Remove()
+ tree.needUpdate = True
+
# Undo info
self.lastOp = 'MOVEUP'
status = 'Moved before previous sibling'
# Prepare undo data
panel.Apply()
+ tree.UnselectAll()
parent = tree.GetItemParent(selected)
elem = tree.RemoveLeaf(selected)
next = tree.GetNextSibling(selected)
if not next: return
+ # Remove highlight, update testWin
+ if g.testWin.highLight:
+ g.testWin.highLight.Remove()
+ tree.needUpdate = True
+
# Undo info
self.lastOp = 'MOVEDOWN'
status = 'Moved after next sibling'
# Prepare undo data
panel.Apply()
+ tree.UnselectAll()
parent = tree.GetItemParent(selected)
elem = tree.RemoveLeaf(selected)
# Check compatibility
if not self.ItemsAreCompatible(tree.GetPyData(pparent).treeObject(), tree.GetPyData(selected).treeObject()): return
+ # Remove highlight, update testWin
+ if g.testWin.highLight:
+ g.testWin.highLight.Remove()
+ tree.needUpdate = True
+
# Undo info
self.lastOp = 'MOVELEFT'
status = 'Made next sibling of parent'
selected = tree.InsertNode(pparent, tree.GetPyData(pparent).treeObject(), elem, nextItem)
newIndex = tree.ItemIndex(selected)
+ tree.oldItem = None
tree.SelectItem(selected)
undoMan.RegisterUndo(UndoMove(oldParent, oldIndex, pparent, newIndex))
# Check compatibility
if not self.ItemsAreCompatible(parent, tree.GetPyData(selected).treeObject()): return
+ # Remove highlight, update testWin
+ if g.testWin.highLight:
+ g.testWin.highLight.Remove()
+ tree.needUpdate = True
+
# Undo info
self.lastOp = 'MOVERIGHT'
status = 'Made last child of previous sibling'
selected = tree.InsertNode(newParent, tree.GetPyData(newParent).treeObject(), elem, wx.TreeItemId())
newIndex = tree.ItemIndex(selected)
+ tree.oldItem = None
tree.SelectItem(selected)
undoMan.RegisterUndo(UndoMove(oldParent, oldIndex, newParent, newIndex))
-
+
self.modified = True
self.SetStatusText(status)