// ----------------------------------------------------------------------------
// a convenient wrapper around TV_ITEM struct which adds a ctor
+#ifdef __VISUALC__
#pragma warning( disable : 4097 )
+#endif
+
struct wxTreeViewItem : public TV_ITEM
{
wxTreeViewItem(const wxTreeItemId& item, // the item handle
hItem = (HTREEITEM) (WXHTREEITEM) item;
}
};
+
+#ifdef __VISUALC__
#pragma warning( default : 4097 )
+#endif
// a class which encapsulates the tree traversal logic: it vists all (unless
// OnVisit() returns FALSE) items under the given one
switch ( hdr->code )
{
+ case NM_RCLICK:
+ {
+ if ( wxControl::MSWOnNotify(idCtrl, lParam, result) )
+ return TRUE;
+
+ TV_HITTESTINFO tvhti;
+ ::GetCursorPos(&(tvhti.pt));
+ ::ScreenToClient(GetHwnd(),&(tvhti.pt));
+ if ( TreeView_HitTest(GetHwnd(),&tvhti) )
+ {
+ if( tvhti.flags & TVHT_ONITEM )
+ {
+ event.m_item = (WXHTREEITEM) tvhti.hItem;
+ eventType=wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK;
+ }
+ }
+ break;
+ }
+
case TVN_BEGINDRAG:
eventType = wxEVT_COMMAND_TREE_BEGIN_DRAG;
// fall through
"message"), tv->action);
}
- bool ing = (hdr->code == TVN_ITEMEXPANDING);
+ bool ing = ((int)hdr->code == TVN_ITEMEXPANDING);
eventType = g_events[expand][ing];
event.m_item = (WXHTREEITEM) tv->itemNew.hItem;