lparameters loNode thisform.CheckChilds(loNode) thisform.CheckParent(loNode)CheckChilds method:
* Auto checks all of the node childs. * This means that if a department is checked, * all employess of the department will be checked also lparameters loNode local loChild if isnull(loNode) return endif loChild=loNode.Child do while not isnull(loChild) loChild.Checked=loNode.Checked thisform.CheckChilds(loChild) loChild=loChild.next enddoCheckParent method:
* This method verifies if a node has all its children checked. * If this is the case, then it checks it and verifies its parent. * Otherwise it unchecks it if applicable lparameters loNode local loParent, llChecked, loChild loParent=loNode.parent if not isnull(loParent) loChild=loParent.Child llChecked=.t. do while not isnull(loChild) and llChecked llChecked=loChild.Checked loChild=loChild.Next enddo loParent.Checked=llChecked thisform.CheckParent(loParent) endifSo, using this I accomplish the following: