// tree DOM handling private static void AddElement(SciterElement tree_el_parent, SciterElement origin_el_add) { SciterNode origin_nd = origin_el_add.ToNode(); Debug.Assert(origin_nd.IsElement); string tag = origin_el_add.Tag; SciterElement tree_el_new = SciterElement.Create("option"); tree_el_parent.Append(tree_el_new); uint uid = origin_el_add.UID; Debug.Assert(uid != 0); tree_el_new.SetAttribute("value", uid.ToString()); tree_el_new.SetHTML(UI_ElementCaption(origin_el_add)); bool has_real_childs = false; uint nchilds = origin_nd.ChildrenCount; for (uint i = 0; i < nchilds; i++) { SciterNode nd = origin_nd[i]; if (nd.IsElement) { AddElement(tree_el_new, nd.ToElement()); has_real_childs = true; } else { bool new_option = AddNode(tree_el_new, uid, nd); if (new_option) { has_real_childs = true; } } } if (has_real_childs) { if (tag == "html" || tag == "body") { tree_el_new.SetState(SciterXDom.ELEMENT_STATE_BITS.STATE_EXPANDED); //tree_el_new.set_attribute("expanded", ""); } else { tree_el_new.SetState(SciterXDom.ELEMENT_STATE_BITS.STATE_COLLAPSED); } } }