X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/84a6b8590b1e95e0325727059660508e4cf4df05..2ee3ee1bc8ac2f95029835ebc115fac0a1fbd02a:/src/msw/treectrl.cpp diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 8517884f18..44c408406b 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -67,7 +67,10 @@ // ---------------------------------------------------------------------------- // 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 @@ -80,7 +83,10 @@ struct wxTreeViewItem : public TV_ITEM 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 @@ -1342,22 +1348,24 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) 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)!=NULL) { - if(tvhti.flags & TVHT_ONITEM) { - event.m_item = (WXHTREEITEM) tvhti.hItem; - eventType=wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK; - } - } - break; - } - + { + 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 @@ -1444,7 +1452,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) "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;