+ return m_anchor == NULL ? 0u : m_anchor->GetChildrenCount();
+}
+
+void wxTreeCtrl::SetIndent(unsigned int indent)
+{
+ m_indent = indent;
+ Refresh();
+}
+
+size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item, bool recursively)
+{
+ wxCHECK_MSG( item.IsOk(), 0u, "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(), "", "invalid tree item" );
+
+ return item.m_pItem->GetText();
+}
+
+int wxTreeCtrl::GetItemImage(const wxTreeItemId& item) const
+{
+ wxCHECK_MSG( item.IsOk(), -1, "invalid tree item" );
+
+ return item.m_pItem->GetImage();
+}
+
+int wxTreeCtrl::GetItemSelectedImage(const wxTreeItemId& item) const
+{
+ wxCHECK_MSG( item.IsOk(), -1, "invalid tree item" );
+
+ return item.m_pItem->GetSelectedImage();
+}
+
+wxTreeItemData *wxTreeCtrl::GetItemData(const wxTreeItemId& item) const
+{
+ wxCHECK_MSG( item.IsOk(), NULL, "invalid tree item" );
+
+ return item.m_pItem->GetData();
+}
+
+void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text)
+{
+ wxCHECK_RET( item.IsOk(), "invalid tree item" );
+
+ wxClientDC dc(this);
+ item.m_pItem->SetText(text, dc);
+}
+
+void wxTreeCtrl::SetItemImage(const wxTreeItemId& item, int image)
+{
+ wxCHECK_RET( item.IsOk(), "invalid tree item" );
+
+ item.m_pItem->SetImage(image);
+}
+
+void wxTreeCtrl::SetItemSelectedImage(const wxTreeItemId& item, int image)
+{
+ wxCHECK_RET( item.IsOk(), "invalid tree item" );
+
+ item.m_pItem->SetSelectedImage(image);
+}
+
+void wxTreeCtrl::SetItemData(const wxTreeItemId& item, wxTreeItemData *data)
+{
+ wxCHECK_RET( item.IsOk(), "invalid tree item" );
+
+ item.m_pItem->SetData(data);
+}
+
+void wxTreeCtrl::SetItemHasChildren(const wxTreeItemId& item, bool has)
+{
+ wxCHECK_RET( item.IsOk(), "invalid tree item" );
+
+ item.m_pItem->SetHasPlus(has);
+}
+
+void wxTreeCtrl::SetItemBold(const wxTreeItemId& item, bool bold)
+{
+ wxCHECK_RET( item.IsOk(), "invalid tree item" );
+
+ // avoid redrawing the tree if no real change
+ wxGenericTreeItem *pItem = item.m_pItem;
+ if ( pItem->IsBold() != bold )
+ {
+ pItem->SetBold(bold);
+ RefreshLine(pItem);
+ }
+}
+
+// -----------------------------------------------------------------------------
+// item status inquiries
+// -----------------------------------------------------------------------------
+
+bool wxTreeCtrl::IsVisible(const wxTreeItemId& WXUNUSED(item)) const
+{
+ wxFAIL_MSG("not implemented");
+
+ return TRUE;
+}
+
+bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const
+{
+ wxCHECK_MSG( item.IsOk(), FALSE, "invalid tree item" );
+
+ return !item.m_pItem->GetChildren().IsEmpty();
+}
+
+bool wxTreeCtrl::IsExpanded(const wxTreeItemId& item) const
+{
+ wxCHECK_MSG( item.IsOk(), FALSE, "invalid tree item" );
+
+ return item.m_pItem->IsExpanded();
+}
+
+bool wxTreeCtrl::IsSelected(const wxTreeItemId& item) const
+{
+ wxCHECK_MSG( item.IsOk(), FALSE, "invalid tree item" );
+
+ return item.m_pItem->HasHilight();
+}
+
+bool wxTreeCtrl::IsBold(const wxTreeItemId& item) const
+{
+ wxCHECK_MSG( item.IsOk(), FALSE, "invalid tree item" );
+
+ return item.m_pItem->IsBold();
+}
+
+// -----------------------------------------------------------------------------
+// navigation
+// -----------------------------------------------------------------------------
+
+wxTreeItemId wxTreeCtrl::GetParent(const wxTreeItemId& item) const
+{
+ wxCHECK_MSG( item.IsOk(), wxTreeItemId(), "invalid tree item" );
+
+ return item.m_pItem->GetParent();
+}
+
+wxTreeItemId wxTreeCtrl::GetFirstChild(const wxTreeItemId& item, long& cookie) const
+{
+ wxCHECK_MSG( item.IsOk(), wxTreeItemId(), "invalid tree item" );
+
+ cookie = 0;
+ return GetNextChild(item, cookie);
+}
+
+wxTreeItemId wxTreeCtrl::GetNextChild(const wxTreeItemId& item, long& cookie) const
+{
+ wxCHECK_MSG( item.IsOk(), wxTreeItemId(), "invalid tree item" );
+
+ wxArrayTreeItems& children = item.m_pItem->GetChildren();
+ if ( (size_t)cookie < children.Count() )