+#if wxUSE_TOOLTIPS
+ wxTreeItemId itemId = event.GetItem();
+ const wxGenericTreeItem* const pItem = (wxGenericTreeItem*)itemId.m_pItem;
+
+ // Check if the item fits into the client area:
+ if ( pItem->GetX() + pItem->GetWidth() > GetClientSize().x )
+ {
+ // If it doesn't, show its full text in the tooltip.
+ event.SetLabel(pItem->GetText());
+ }
+ else
+#endif // wxUSE_TOOLTIPS
+ {
+ // veto processing the event, nixing any tooltip
+ event.Veto();
+ }