+ wxDELETE( m_hilightBrush );
+
+ DeleteAllItems();
+}
+
+// -----------------------------------------------------------------------------
+// accessors
+// -----------------------------------------------------------------------------
+
+size_t wxTreeCtrl::GetCount() const
+{
+ return m_anchor == NULL ? 0u : m_anchor->GetChildrenCount();
+}
+
+void wxTreeCtrl::SetIndent(unsigned int indent)
+{
+ m_indent = indent;
+ m_dirty = TRUE;
+ Refresh();
+}
+
+void wxTreeCtrl::SetSpacing(unsigned int spacing)
+{
+ m_spacing = spacing;
+ m_dirty = TRUE;
+ Refresh();
+}
+
+size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item, bool recursively)
+{
+ wxCHECK_MSG( item.IsOk(), 0u, _T("invalid tree item") );
+
+ return item.m_pItem->GetChildrenCount(recursively);
+}
+
+// -----------------------------------------------------------------------------
+// functions to work with tree items
+// -----------------------------------------------------------------------------
+
+wxString wxTreeCtrl::GetItemText(const wxTreeItemId& item) const
+{
+ wxCHECK_MSG( item.IsOk(), _T(""), _T("invalid tree item") );
+
+ return item.m_pItem->GetText();
+}
+
+int wxTreeCtrl::GetItemImage(const wxTreeItemId& item) const
+{
+ wxCHECK_MSG( item.IsOk(), -1, _T("invalid tree item") );
+
+ return item.m_pItem->GetImage();
+}
+
+int wxTreeCtrl::GetItemSelectedImage(const wxTreeItemId& item) const
+{
+ wxCHECK_MSG( item.IsOk(), -1, _T("invalid tree item") );
+
+ return item.m_pItem->GetSelectedImage();
+}
+
+wxTreeItemData *wxTreeCtrl::GetItemData(const wxTreeItemId& item) const
+{
+ wxCHECK_MSG( item.IsOk(), NULL, _T("invalid tree item") );
+
+ return item.m_pItem->GetData();
+}
+
+void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text)
+{
+ wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
+
+ wxClientDC dc(this);
+ wxGenericTreeItem *pItem = item.m_pItem;
+ pItem->SetText(text, dc);
+ RefreshLine(pItem);
+}
+
+void wxTreeCtrl::SetItemImage(const wxTreeItemId& item, int image)
+{
+ wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
+
+ wxGenericTreeItem *pItem = item.m_pItem;
+ pItem->SetImage(image);
+ RefreshLine(pItem);
+}
+
+void wxTreeCtrl::SetItemSelectedImage(const wxTreeItemId& item, int image)
+{
+ wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
+
+ wxGenericTreeItem *pItem = item.m_pItem;
+ pItem->SetSelectedImage(image);
+ RefreshLine(pItem);
+}
+
+void wxTreeCtrl::SetItemData(const wxTreeItemId& item, wxTreeItemData *data)
+{
+ wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
+
+ item.m_pItem->SetData(data);
+}
+
+void wxTreeCtrl::SetItemHasChildren(const wxTreeItemId& item, bool has)
+{
+ wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
+
+ wxGenericTreeItem *pItem = item.m_pItem;
+ pItem->SetHasPlus(has);
+ RefreshLine(pItem);
+}
+
+void wxTreeCtrl::SetItemBold(const wxTreeItemId& item, bool bold)
+{
+ wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
+
+ // avoid redrawing the tree if no real change
+ wxGenericTreeItem *pItem = item.m_pItem;
+ if ( pItem->IsBold() != bold )