BOOL CDuiListBox::LoadChildren(pugi::xml_node xmlNode) { if(!xmlNode) return TRUE; pugi::xml_node xmlParent=xmlNode.parent(); pugi::xml_node xmlItem=xmlParent.child("items"); while(xmlItem) { LPLBITEM pItemObj = new LBITEM; LoadItemAttribute(xmlItem, pItemObj); InsertItem(-1, pItemObj); xmlItem = xmlItem.next_sibling(); } int nSelItem=xmlParent.attribute("cursel").as_int(-1); SetCurSel(nSelItem); return TRUE; }
BOOL SListBox::CreateChildren(pugi::xml_node xmlNode) { if(!xmlNode) return TRUE; pugi::xml_node xmlItems=xmlNode.child(L"items"); if(xmlItems) { pugi::xml_node xmlItem= xmlItems.child(L"item"); while(xmlItem) { LPLBITEM pItemObj = new LBITEM; LoadItemAttribute(xmlItem, pItemObj); InsertItem(-1, pItemObj); xmlItem = xmlItem.next_sibling(); } } int nSelItem=xmlNode.attribute(L"curSel").as_int(-1); SetCurSel(nSelItem); return TRUE; }