My expectation of this functionality is that the disabled child item should maintain it's state as it is disabled an the user can not click on it to change its state. However when the user clicks the parent they can change the state of the disabled child checkboxes.
Is this a bug or is this the intended functionality of checkboxes in the Tree widget?
Here is the code from the help file with checkboxes added to be able to demonstrate what I have described above:
Code: Select all
main()
{
//Add three columns
TREE1.addColumn("SURNAME");
TREE1.addColumn("FIRST NAME");
TREE1.addColumn("ADDRESS");
//Append the "WHOLE NAME" item
TREE1.appendItemNC("","WHOLE NAME","WHOLE_NAME");
//Append three sub items
TREE1.appendItemNC("WHOLE NAME","MUELLER","Mueller");
TREE1.appendItemNC("WHOLE NAME","SCHMIDT","Schmidt");
TREE1.appendItemNC("WHOLE NAME","KAUFMANN",makeDynString("Kaufmann","Jan","Nebenstr. 100"));
//Set the texts in the "FIRST NAME" column
TREE1.setText("MUELLER", 1, "Maria");
TREE1.setText("SCHMIDT", 1, "Anna");
//Set the texts in the "ADDRESS" column
TREE1.setText("MUELLER",2, "Hauptstr. 1");
TREE1.setText("SCHMIDT",2, "Wienerstr. 10");
//Append three subitems below the "MUELLER" item
TREE1.appendItemNC("MUELLER","CHILDREN_M0","CHILDREN");
TREE1.appendItemNC("MUELLER","CHILDREN_M1","");
TREE1.appendItemNC("MUELLER","CHILDREN_M2","");
// Set Checkable
TREE1.setCheckable("MUELLER", TRUE);
TREE1.setCheckable("CHILDREN_M0", TRUE);
TREE1.setCheckable("CHILDREN_M1", TRUE);
TREE1.setCheckable("CHILDREN_M2", TRUE);
// Disable one child
TREE1.setEnabled("CHILDREN_M1", FALSE);
//Set the texts in the "FIRST NAME" column at the CHILDREN items
TREE1.setText("CHILDREN_M1",1,"Klaus");
TREE1.setText("CHILDREN_M2",1,"Anika");
}