The code iterates through all "bold" nodes of the treeview and checks those nodes which have checked child nodes. Since you do not show the entire procedure I cannot tell whether these checks are restricted only to the node and its direct children, or whether the entire tree is affected.
AFAIK the LCL treeview does not support checkboxes. But using an imagelist with checked and unchecked icons you can easily imitate the effect. You'll have to write some code which selects the checked or unchecked image. Please look at the attached demo which contains routines to check the top-level parent if any of its children is checked. It is a nice exercise in recursive programming.