+ def AutoCheckParent(self, item, checked):
+ """Traverses up the tree and checks/unchecks parent items.
+ Meaningful only for check items."""
+
+ if not item:
+ raise "\nERROR: Invalid Tree Item. "
+
+ parent = item.GetParent()
+ if not parent or parent.GetType() != 1:
+ return
+
+ (child, cookie) = self.GetFirstChild(parent)
+ while child:
+ if child.GetType() == 1 and child.IsEnabled():
+ if checked != child.IsChecked():
+ return
+ (child, cookie) = self.GetNextChild(parent, cookie)
+
+ self.CheckItem2(parent, checked, torefresh=True)
+ self.AutoCheckParent(parent, checked)
+
+