+
+static void RecursivelyExpand(wxTreeCtrl *t, wxTreeItemId item)
+{
+ t->Expand(item);
+ long cookie;
+ wxTreeItemId id = t->GetFirstChild(item, cookie);
+ while (id.IsOk())
+ {
+ RecursivelyExpand(t, id);
+ id = t->GetNextChild(item, cookie);
+ }
+}
+
bool EditorFrame::SelectNode(wxXmlNode *node, wxTreeItemId *root)
{
if (root == NULL)
nd = (dt) ? dt->Node : NULL;
if (nd == node)
{
+ RecursivelyExpand(m_TreeCtrl, *root);
m_TreeCtrl->SelectItem(item);
m_TreeCtrl->EnsureVisible(item);
- return TRUE;
+ return TRUE;
}
if (m_TreeCtrl->ItemHasChildren(item) && SelectNode(node, &item))
- return TRUE;
+ return TRUE;
item = m_TreeCtrl->GetNextChild(*root, cookie);
}
+
return FALSE;
}
-static void RecursivelyExpand(wxTreeCtrl *t, wxTreeItemId item)
-{
- t->Expand(item);
- long cookie;
- wxTreeItemId id = t->GetFirstChild(item, cookie);
- while (id.IsOk())
- {
- RecursivelyExpand(t, id);
- id = t->GetNextChild(item, cookie);
- }
-}
-
void EditorFrame::OnTreeSel(wxTreeEvent& event)
{
XmlTreeData *dt = (XmlTreeData*)(m_TreeCtrl->GetItemData(event.GetItem()));