+// macros to hide the cast ugliness
+// --------------------------------
+
+// ptr is the real item id, i.e. wxTreeItemId::m_pItem
+#define HITEM_PTR(ptr) (HTREEITEM)(ptr)
+
+// item here is a wxTreeItemId
+#define HITEM(item) HITEM_PTR((item).m_pItem)