Updated to TreeMixin 0.7

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@44574 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2007-02-26 23:35:07 +00:00
parent ee059415c1
commit 25f8729c3d
2 changed files with 46 additions and 35 deletions

View File

@@ -25,8 +25,8 @@ The VirtualTree and DragAndDrop mixins force the wx.TR_HIDE_ROOT style.
Author: Frank Niessink <frank@niessink.com>
License: wxWidgets license
Version: 0.6
Date: 17 February 2007
Version: 0.7
Date: 22 February 2007
ExpansionState is based on code and ideas from Karsten Hilbert.
Andrea Gavana provided help with the CustomTreeCtrl integration.
@@ -143,7 +143,7 @@ class TreeAPIHarmonizer(object):
return children
def ItemIndices(self, item):
''' Construct an index typle for item. The root item is () the
''' Construct an index typle for item. The root item is (), the
first child of the root item is (0,), the second child of the
root item is (1,), the first child of the first child of the
root item is (0, 0), the second child of the first child of the
@@ -409,8 +409,8 @@ class DragAndDrop(TreeAPIHarmonizer):
def OnBeginDrag(self, event):
# We allow only one item to be dragged at a time, to keep it simple
self._dragItem = self.GetSelections()[0]
if self._dragItem:
self._dragItem = event.GetItem()
if self._dragItem and self._dragItem != self.GetRootItem():
self.StartDragging()
event.Allow()
else: