+ wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") );
+
+ // An item is only visible if it's not a descendant of a collapsed item
+ wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem;
+ wxGenericTreeItem* parent = pItem->GetParent();
+ while (parent)
+ {
+ if (!parent->IsExpanded())
+ return FALSE;
+ parent = parent->GetParent();
+ }
+
+ int startX, startY;
+ GetViewStart(& startX, & startY);
+
+ wxSize clientSize = GetClientSize();
+
+ wxRect rect;
+ if (!GetBoundingRect(item, rect))
+ return FALSE;
+ if (rect.GetWidth() == 0 || rect.GetHeight() == 0)
+ return FALSE;
+ if (rect.GetBottom() < 0 || rect.GetTop() > clientSize.y)
+ return FALSE;
+ if (rect.GetRight() < 0 || rect.GetLeft() > clientSize.x)
+ return FALSE;